aboutsummaryrefslogtreecommitdiffstats
path: root/Cakefile
diff options
context:
space:
mode:
authorJohan Liesén2012-08-07 16:43:48 +0200
committerJohan Liesén2012-08-07 17:01:28 +0200
commit57bc52a4fc7b64eb88415fba2e6dd95f499c3b6a (patch)
tree033560a4b938f90903678c35633bdea3a256b70c /Cakefile
parenta3ada283711d73737e5de13f5cb5d30f23a8312c (diff)
downloadvimium-57bc52a4fc7b64eb88415fba2e6dd95f499c3b6a.tar.bz2
Use path module
Diffstat (limited to 'Cakefile')
-rw-r--r--Cakefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Cakefile b/Cakefile
index a90f7e64..e1434d24 100644
--- a/Cakefile
+++ b/Cakefile
@@ -1,4 +1,5 @@
fs = require "fs"
+path = require "path"
{spawn, exec} = require "child_process"
spawn_with_opts = (proc_name, opts) ->
@@ -16,13 +17,13 @@ task "build", "compile all coffeescript files to javascript", ->
task "clean", "removes any js files which were compiled from coffeescript", ->
src_directories.forEach (directory) ->
fs.readdirSync(directory).forEach (filename) ->
- return if (filename.indexOf ".js", filename.length - ".js".length) == -1
- filepath = "#{directory}/#{filename}"
+ return unless (path.extname filename) == ".js"
+ filepath = path.join directory, filename
return unless (fs.statSync filepath).isFile()
# Check if there exists a corresponding .coffee file
try
- coffeeFile = fs.statSync "#{filepath.slice 0, -".js".length}.coffee"
+ coffeeFile = fs.statSync path.join directory, "#{path.basename filepath, ".js"}.coffee"
catch _
return