diff options
| author | Jez Ng | 2012-09-08 14:48:27 -0400 | 
|---|---|---|
| committer | Jez Ng | 2012-09-08 14:48:27 -0400 | 
| commit | 5961f89c2be187d2ed64259be74266406dc37a79 (patch) | |
| tree | c2a858aac9cf953a5195dd5d3ad6bf3226b3a10a /Cakefile | |
| parent | eab9ac32db6cf9567e2c1b2499e794c2f66210c1 (diff) | |
| download | vimium-5961f89c2be187d2ed64259be74266406dc37a79.tar.bz2 | |
Remove src_directories.
More maintainable & sufficiently quick to just build everything under
the project root.
Diffstat (limited to 'Cakefile')
| -rw-r--r-- | Cakefile | 17 | 
1 files changed, 9 insertions, 8 deletions
| @@ -8,20 +8,19 @@ spawn_with_opts = (proc_name, opts) ->      opt_array.push "--#{key}=#{value}"    spawn proc_name, opt_array -src_directories = ["tests", "background_scripts", "content_scripts", "lib", "options", -                   "test_harnesses/automated"] -  task "build", "compile all coffeescript files to javascript", -> -  coffee = spawn "coffee", ["-c"].concat(src_directories) +  coffee = spawn "coffee", ["-c", __dirname]    coffee.stdout.on "data", (data) -> console.log data.toString().trim()    coffee.stderr.on "data", (data) -> console.log data.toString().trim()  task "clean", "removes any js files which were compiled from coffeescript", -> -  src_directories.forEach (directory) -> +  visit = (directory) ->      fs.readdirSync(directory).forEach (filename) -> -      return unless (path.extname filename) == ".js"        filepath = path.join directory, filename -      return unless (fs.statSync filepath).isFile() +      if (fs.statSync filepath).isDirectory() +        return visit filepath + +      return unless (path.extname filename) == ".js" and (fs.statSync filepath).isFile()        # Check if there exists a corresponding .coffee file        try @@ -31,8 +30,10 @@ task "clean", "removes any js files which were compiled from coffeescript", ->        fs.unlinkSync filepath if coffeeFile.isFile() +  visit __dirname +  task "autobuild", "continually rebuild coffeescript files using coffee --watch", -> -  coffee = spawn "coffee", ["-cw"].concat(src_directories) +  coffee = spawn "coffee", ["-cw", __dirname]    coffee.stdout.on "data", (data) -> console.log data.toString().trim()    coffee.stderr.on "data", (data) -> console.log data.toString().trim() | 
