mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Fixed deep directory creation for command line utility
This commit is contained in:
parent
f48aa44386
commit
457cdfde26
3 changed files with 11 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
// Generated by CoffeeScript 1.6.3
|
||||
(function() {
|
||||
var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, helpers, hidden, joinTimeout, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, useWinPathSep, version, wait, watch, watchDir, watchers, writeJs, _ref;
|
||||
var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, helpers, hidden, joinTimeout, mkdirp, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, useWinPathSep, version, wait, watch, watchDir, watchers, writeJs, _ref;
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
|||
|
||||
CoffeeScript = require('./coffee-script');
|
||||
|
||||
mkdirp = require('mkdirp');
|
||||
|
||||
_ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec;
|
||||
|
||||
EventEmitter = require('events').EventEmitter;
|
||||
|
@ -425,8 +427,8 @@
|
|||
});
|
||||
}
|
||||
};
|
||||
return exists(jsDir, function(itExists) {
|
||||
if (itExists) {
|
||||
return mkdirp(jsDir, function(err) {
|
||||
if (!err) {
|
||||
return compile();
|
||||
} else {
|
||||
return exec("mkdir -p " + jsDir, compile);
|
||||
|
|
|
@ -31,5 +31,8 @@
|
|||
"devDependencies": {
|
||||
"uglify-js": "~2.2",
|
||||
"jison": ">=0.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"mkdirp": "~0.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ path = require 'path'
|
|||
helpers = require './helpers'
|
||||
optparse = require './optparse'
|
||||
CoffeeScript = require './coffee-script'
|
||||
mkdirp = require 'mkdirp'
|
||||
{spawn, exec} = require 'child_process'
|
||||
{EventEmitter} = require 'events'
|
||||
|
||||
|
@ -283,8 +284,8 @@ writeJs = (base, sourcePath, js, jsPath, generatedSourceMap = null) ->
|
|||
fs.writeFile sourceMapPath, generatedSourceMap, (err) ->
|
||||
if err
|
||||
printLine "Could not write source map: #{err.message}"
|
||||
exists jsDir, (itExists) ->
|
||||
if itExists then compile() else exec "mkdir -p #{jsDir}", compile
|
||||
mkdirp jsDir, (err) ->
|
||||
unless err then compile() else exec "mkdir -p #{jsDir}", compile
|
||||
|
||||
# Convenience for cleaner setTimeouts.
|
||||
wait = (milliseconds, func) -> setTimeout func, milliseconds
|
||||
|
|
Loading…
Add table
Reference in a new issue