Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into express

Conflicts:
	npm-shrinkwrap.json
  • Loading branch information...
commit 5491a2957f6d01c62406e240c24a50cab572da95 2 parents 875f8a2 + 03cc79b
@winton authored
Showing with 48 additions and 138 deletions.
  1. +39 −27 bin/node-template.coffee
  2. +9 −111 npm-shrinkwrap.json
View
66 bin/node-template.coffee
@@ -1,9 +1,10 @@
{ exec } = require "child_process"
-path = require "path"
+fs = require "fs"
+path = require "path"
-require "colors"
-glob = require "glob"
-_ = require "underscore"
+colors = require "colors"
+glob = require "glob"
+_ = require "underscore"
module.exports = class Bin
constructor: (options={}) ->
@@ -63,32 +64,13 @@ module.exports = class Bin
"rm test/node-template.coffee"
]
- # Overwrite files to remove node-template code
-
- @overwrite =
- "bin/node-template": """
- #!/usr/bin/env node
-
- require("../lib/#{name}");
- """
- "src/node-template.coffee": """
- common = require './#{name}/common'
- async = common.async
- _ = common.underscore
- """
-
- _.each @overwrite, (body, path) ->
- body = body.replace(/\n/g, "\\n").replace(/"/g, "\\\"")
- commands.push "echo \"#{body}\" > #{path}"
-
@executing(commands)
exec commands.join(' && '), @catchError =>
- dir = if dir then "#{dir}/" else ""
- cwd = process.cwd()
-
+ dir = if dir then "#{dir}/" else ""
commands = []
+ cwd = process.cwd()
glob "#{dir}#{name}/**/node-template*", (e, paths) =>
_.each paths, (path) ->
@@ -97,12 +79,42 @@ module.exports = class Bin
@executing(commands)
exec commands.join(' && '), @catchError =>
- commands = [
- "cd #{dir}#{name}"
+
+ commands = [ "cd #{dir}#{name}" ]
+
+ # Overwrite files to remove node-template code
+
+ overwrite = {}
+
+ overwrite["bin/#{name}"] =
+ """
+ #!/usr/bin/env node
+
+ require("../lib/#{name}");
+ """
+
+ overwrite["src/#{name}.coffee"] =
+ """
+ common = require './#{name}/common'
+ async = common.async
+ _ = common.underscore
+ """
+
+ _.each overwrite, (body, path) ->
+ if fs.existsSync("#{dir}#{name}/#{path}")
+ body = body.replace(/\n/g, "\\n").replace(/"/g, "\\\"")
+ commands.push "echo \"#{body}\" > #{path}"
+
+ if fs.existsSync("#{dir}#{name}/src")
+ commands.push("coffee -o lib -c src")
+
+ commands = commands.concat [
"cake install"
"cd #{cwd}"
]
+
@executing(commands)
+
exec commands.join(' && '), ->
if options.done then options.done() else process.exit()
View
120 npm-shrinkwrap.json
@@ -1,74 +1,12 @@
{
"name": "node-template",
- "version": "0.1.2",
+ "version": "0.1.5",
"dependencies": {
"async": {
"version": "0.1.22"
},
- "backbone": {
- "version": "0.9.2"
- },
- "connect-redis": {
- "version": "1.4.1",
- "dependencies": {
- "debug": {
- "version": "0.7.0"
- }
- }
- },
- "express": {
- "version": "3.0.0rc3",
- "dependencies": {
- "connect": {
- "version": "2.4.3",
- "dependencies": {
- "qs": {
- "version": "0.4.2"
- },
- "formidable": {
- "version": "1.0.11"
- },
- "bytes": {
- "version": "0.1.0"
- },
- "pause": {
- "version": "0.0.1"
- }
- }
- },
- "commander": {
- "version": "0.6.1"
- },
- "range-parser": {
- "version": "0.0.4"
- },
- "mkdirp": {
- "version": "0.3.3"
- },
- "cookie": {
- "version": "0.0.4"
- },
- "crc": {
- "version": "0.2.0"
- },
- "fresh": {
- "version": "0.1.0"
- },
- "methods": {
- "version": "0.0.1"
- },
- "send": {
- "version": "0.0.3",
- "dependencies": {
- "mime": {
- "version": "1.2.6"
- }
- }
- },
- "debug": {
- "version": "0.7.0"
- }
- }
+ "colors": {
+ "version": "0.6.0-1"
},
"glob": {
"version": "3.1.11",
@@ -89,60 +27,17 @@
}
}
},
- "nodetime": {
- "version": "0.4.4",
- "dependencies": {
- "agent.io": {
- "version": "0.1.6",
- "dependencies": {
- "request": {
- "version": "2.10.0"
- }
- }
- },
- "timekit": {
- "version": "0.1.9",
- "dependencies": {
- "bindings": {
- "version": "1.0.0"
- }
- }
- },
- "v8tools": {
- "version": "0.1.1",
- "dependencies": {
- "bindings": {
- "version": "1.0.0"
- }
- }
- }
- }
- },
- "redis": {
- "version": "0.7.2",
- "dependencies": {
- "hiredis": {
- "version": "0.1.14"
- }
- }
- },
"underscore": {
"version": "1.3.3"
},
- "coffee-script": {
- "version": "1.3.3"
- },
- "colors": {
- "version": "0.6.0-1"
- },
"chai": {
"version": "1.2.0"
},
- "supervisor": {
- "version": "0.4.1"
+ "coffee-script": {
+ "version": "1.3.3"
},
"mocha": {
- "version": "1.3.2",
+ "version": "1.4.2",
"dependencies": {
"commander": {
"version": "0.6.1"
@@ -163,6 +58,9 @@
},
"debug": {
"version": "0.7.0"
+ },
+ "mkdirp": {
+ "version": "0.3.3"
}
}
},
Please sign in to comment.
Something went wrong with that request. Please try again.