-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: can't pass a path from the command line when creating Durandal skeleton project #339
Comments
As noted by Brandon Pugh (http://stackoverflow.com/a/21055014/614523) this bug may be that the command line does not accept absolute paths. |
I believe the reason is here with concatenating the outPath var: A quick fix would be using a regex if(/^\\(?!\\)/.test(path)){
outPath = name; // path is absolute
}else{
outPath = path.join(process.cwd(), name) // path is relative
}
this.skeletonOutPath = name ? (fs.existsSync(outPath) ? (logger.error("Directory/file exists at [[ " + outPath + " ]], cannot continue."), process.exit(0)) : void 0, outPath) : path.dirname(outPath); It's not tested, but should work. http://nodejs.org/api/process.html#process_process_cwd |
This problem is in skelmimosa, not mimosa proper. Which doesn't mean that it necessarily wouldn't be an issue in https://github.com/dbashford/skelmimosa/blob/master/src/command/new.coffee#L25 I never meant you to be able to pass full paths, just essentially the name of the folder you'd like skel:new to create. But I can see how providing a full path would be nice. I'll play with it. I imagine this won't work on #nix either. At least not well. |
Why not just check for "" or "/" in pathname and if so, it's supposed to be absolute? |
I've published what I believe to be a fix for this. Hard to say on windows since I cannot test that.
|
Command: PS D:\dev> mimosa new D:\dev\test fs.js:642
return binding.mkdir(pathModule._makeLong(path),
^
Error: ENOENT, no such file or directory 'D:\dev\D:\dev\test'
at Object.fs.mkdirSync (fs.js:642:18)
at NewCommand._moveDirectoryContents (D:\apps\scoop\apps\nodejs\0.10.23\node
_modules\mimosa\lib\command\new.js:164:10)
at NewCommand._create (D:\apps\scoop\apps\nodejs\0.10.23\node_modules\mimosa
\lib\command\new.js:132:10)
at NewCommand._create (D:\apps\scoop\apps\nodejs\0.10.23\node_modules\mimosa
\lib\command\new.js:2:59)
at D:\apps\scoop\apps\nodejs\0.10.23\node_modules\mimosa\lib\command\new.js:
97:28
at D:\apps\scoop\apps\nodejs\0.10.23\node_modules\mimosa\node_modules\comman
der\index.js:1073:9
at ReadStream.<anonymous> (D:\apps\scoop\apps\nodejs\0.10.23\node_modules\mi
mosa\node_modules\commander\index.js:860:5)
at ReadStream.g (events.js:180:16)
at ReadStream.EventEmitter.emit (events.js:95:17)
at ReadStream.<anonymous> (_stream_readable.js:746:14)
at ReadStream.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at ReadStream.Readable.push (_stream_readable.js:127:10)
at TTY.onread (net.js:526:21) PS D:\dev> mimosa -V
1.3.9 Edit: outPath = path.join process.cwd(), name Still wrong |
That's a similar though different issue. Could you copy paste that as a new issue? Away from my laptop. On 2014-01-11 22:54:43 +0000 Anachron [email protected] wrote:
|
Opened as new issue: #340 |
Thanks much! On 2014-01-11 23:07:34 +0000 Anachron [email protected] wrote:
|
Running with path breaks:
but doing so without the path is fine:
I was recommended to use the path in the Durandal docs, so please forgive me if this is not the recommended way. I had a quick look at the Mimosa docs and couldn't see anything obvious.
SO question: http://stackoverflow.com/q/21053251/614523
The text was updated successfully, but these errors were encountered: