Giter Site home page Giter Site logo

Windows Support not working about run-rs HOT 5 CLOSED

vkarpov15 avatar vkarpov15 commented on June 20, 2024
Windows Support not working

from run-rs.

Comments (5)

vkarpov15 avatar vkarpov15 commented on June 20, 2024 1

Merged @chaiwa-berian 's PR and released 0.3.2 👍

from run-rs.

chaiwa-berian avatar chaiwa-berian commented on June 20, 2024

@StephaneMartignier I am experiencing the exact same error. It worked the first time I used it, about a week ago, but it has been failing the whole of this week. Uninstalled and re-installed it several times to no luck!

from run-rs.

chaiwa-berian avatar chaiwa-berian commented on June 20, 2024

@StephaneMartignier After carefully looking at the code, I noticed that the code on line number 66 of the index.js could potentially be the cause of the error. Here is the reason:

If you run run-rs -v 4.0.2 --shell without specifying the value for --dbpath, the code will return ./data as the dbPath to be used on line number 69 and line number 80!

This will fail on windows because dbPath will always be ./data whenever the --dbpath option is not passed, and so the code on lines 69 and 80 will always resolve to the path below which is not a correct syntax for a windows path that md command expects:
md .\./data !

To resolve this potential bug for windows users, the code on line 66 can be refactored to something like below:

let dbPath;
if(typeof commander.dbpath === 'string'){
   dbPath = `${commander.dbpath}` ;
}
else {
   dbPath = isWin ? 'data' : './data';
}

Note: I have not tested this code but I believe it should be able to fix the issue! Let me know what you think about this! :)

from run-rs.

chaiwa-berian avatar chaiwa-berian commented on June 20, 2024

I have submitted a pull request for this issue. See Pull request #14

from run-rs.

StephaneMartignier avatar StephaneMartignier commented on June 20, 2024

I also think that your pr will solve the issue.

Also, in the documentation for the --dbpath option it's written "dbPath" in the example command. It's should be "dbpath"

from run-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.