diff options
| author | Johan Liesén | 2012-08-07 10:13:16 +0200 | 
|---|---|---|
| committer | Johan Liesén | 2012-08-07 10:32:53 +0200 | 
| commit | 92814351ffbeded7e00d433daf2b22812fa1b41f (patch) | |
| tree | 3fb88d2b36d58777ee973ae71ad5207f7076cecf /Cakefile | |
| parent | 9d17e9c0bca61b67f3eae0f220acc3bd5ce439d1 (diff) | |
| download | vimium-92814351ffbeded7e00d433daf2b22812fa1b41f.tar.bz2 | |
Keep main.js when doing `cake clean`
Diffstat (limited to 'Cakefile')
| -rw-r--r-- | Cakefile | 9 | 
1 files changed, 6 insertions, 3 deletions
| @@ -15,9 +15,12 @@ task "build", "compile all coffeescript files to javascript", ->  task "clean", "removes any js files which were compiled from coffeescript", ->    src_directories.forEach (directory) -> -    files = fs.readdirSync(directory).filter((filename) -> filename.indexOf(".js") > 0) -    files = files.map((filename) -> "#{directory}/#{filename}") -    files.forEach((file) -> fs.unlinkSync file if fs.statSync(file).isFile()) +    fs.readdirSync(directory).forEach (filename) -> +      return if (filename.indexOf ".js", filename.length - ".js".length) == -1 +      filepath = "#{directory}/#{filename}" +      return if filepath == "background_scripts/main.js" +      return unless (fs.statSync filepath).isFile() +      fs.unlinkSync filepath  task "autobuild", "continually rebuild coffeescript files using coffee --watch", ->    coffee = spawn "coffee", ["-cw"].concat(src_directories) | 
