Browse files

up

  • Loading branch information...
1 parent c618a56 commit 1acf439934fe6ba0b5f1a3599a2fb00a935b0951 @contra contra committed Oct 9, 2011
Showing with 11 additions and 11 deletions.
  1. +1 −1 lib/izpack.coffee
  2. +10 −10 lib/util.coffee
View
2 lib/izpack.coffee
@@ -40,7 +40,7 @@ module.exports =
jar -> async.parallel [app, exe], cb
- # This is a trainwreck of converting a JSON object to XML
+ # This is a trainwreck of converting a settings to iZXML
generateXML: (dirs, pack, opt, cb) ->
log.info 'Generating installer configuration...'
View
20 lib/util.coffee
@@ -12,12 +12,12 @@ module.exports =
exec cmd, (err, stdout, stderr) ->
err ?= stderr if stderr? and !stderr.containsIgnoreCase 'Ignoring unknown extended header keyword'
cb err
-
+
cloneDirectory: (dir, newdir, ignore, excludes, cb) ->
if !cb
cb = excludes
excludes = []
-
+
clone = (file, call) ->
oldf = path.join dir, file
newf = path.join newdir, file
@@ -31,14 +31,14 @@ module.exports =
fs.writeFile newf, data, (err) ->
throw err if err
call()
-
+
copyAll = (call) ->
fs.readdir dir, (err, files) ->
excludes = excludes.unique()
files ?= []
files = (x for x in files when excludes.indexOf(x) is -1) # TODO: REGEX TESTING
async.forEach files, clone, call
-
+
npmExclude = (call) ->
npmignore = path.join dir, '/.npmignore'
path.exists npmignore, (exists) ->
@@ -47,7 +47,7 @@ module.exports =
throw err if err
excludes.merge data.toString().split '\n'
call()
-
+
gitExclude = (call) ->
gitignore = path.join dir, '/.gitignore'
path.exists gitignore, (exists) ->
@@ -56,18 +56,18 @@ module.exports =
throw err if err
excludes.merge data.toString().split '\n'
call()
-
+
run = (call) ->
- if ignore
+ if ignore
async.parallel [npmExclude, gitExclude], -> copyAll call
else
copyAll call
-
+
path.exists newdir, (exists) ->
if exists
run cb
else
- fs.mkdir newdir, 0755, (err) ->
+ fs.mkdir newdir, 0755, (err) ->
throw err if err
run cb
-
+

0 comments on commit 1acf439

Please sign in to comment.