aboutsummaryrefslogtreecommitdiffstats
path: root/Cakefile
diff options
context:
space:
mode:
authorJohan Liesén2012-08-07 10:13:16 +0200
committerJohan Liesén2012-08-07 10:32:53 +0200
commit92814351ffbeded7e00d433daf2b22812fa1b41f (patch)
tree3fb88d2b36d58777ee973ae71ad5207f7076cecf /Cakefile
parent9d17e9c0bca61b67f3eae0f220acc3bd5ce439d1 (diff)
downloadvimium-92814351ffbeded7e00d433daf2b22812fa1b41f.tar.bz2
Keep main.js when doing `cake clean`
Diffstat (limited to 'Cakefile')
-rw-r--r--Cakefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/Cakefile b/Cakefile
index 0a45abac..7506f349 100644
--- a/Cakefile
+++ b/Cakefile
@@ -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)