Build creates a '-p' folder

I'm not 100% what causes this, but something goes past me with the CoffeeScript compiler (coffee.cmd). I just got node.js and CoffeeScript installed on my windows machine. If I compile a file like this:

coffee.cmd -c test.coffee 

I get test.js perfectly fine. I have a script assembly installed in Sublime Text 2 that is generalized, so I can build from any directory. When it compiles, it uses the full path to the file, for example:

 coffee.cmd -c C:\Users\Spencer\test.coffee 

Now this prints test.js as expected, but for some reason it also creates an empty '-p' in the same directory. I don’t know exactly why this is done. Any help would be greatly fixed. Thanks!

+4
source share
1 answer

I'm not sure I don't have Windows, but command.coffee has the following:

 # Write out a JavaScript source file with the compiled code. By default, files # are written out in `cwd` as `.js` files with the same name, but the output # directory can be customized with `--output`. writeJs = (source, js, base) -> #... path.exists jsDir, (exists) -> if exists then compile() else exec "mkdir -p #{jsDir}", compile 

And that looks like an excellent candidate for the source of your problem. On a Unixish system (Linux, OSX, FreeBSD, Cygwin, ...), mkdir -p will create the desired directory and any intermediate directories that are required. I suspect that the standard Windows mkdir does not know what -p means, so two directories are created instead.

You can fix your local version of the CoffeeScript compiler source to use the mkdir -p version for Windows, or you can try installing Cygwin to get mkdir that knows what -p means. Sending a bug report to CoffeeScript maintainers will also be a pleasant touch (but probably not necessary, as they will find this question themselves).

+7
source

Source: https://habr.com/ru/post/1394328/


All Articles