Skip to content
Browse files

safer build

  • Loading branch information...
1 parent 233626e commit 8693480431e0f7477752c6db72eba8f937da3b0f @hickford committed
Showing with 7 additions and 5 deletions.
  1. +7 −5 Cakefile
View
12 Cakefile
@@ -4,16 +4,18 @@ fs = require 'fs'
task 'build', 'Compile Coffeescript source to Javascript', ->
command = require 'iced-coffee-script/lib/coffee-script/command'
process.argv[2..]=['-o','lib','-c','src']
- command.run() # this returns early and doesn't indicate error
+ command.run() # alas, this returns early and doesn't indicate error
- # wait a little
- await setTimeout(defer(),1000)
-
# prepend shebang until issue fixed
# https://github.com/jashkenas/coffee-script/issues/2215
-
+
script_path = path.join('lib','imgurgitate.js')
shebang = "#!/usr/bin/env node"
+
+ # wait until script built
+ while ! path.existsSync(script_path)
+ await setTimeout(defer(),1000)
+
fs.writeFileSync(script_path,[shebang,fs.readFileSync(script_path)].join("\n"))

0 comments on commit 8693480

Please sign in to comment.
Something went wrong with that request. Please try again.