Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' into express

Conflicts:
	npm-shrinkwrap.json
  • Loading branch information...
commit 5491a2957f6d01c62406e240c24a50cab572da95 2 parents 875f8a2 + 03cc79b
Winton Welsh authored

Showing 2 changed files with 48 additions and 138 deletions. Show diff stats Hide diff stats

  1. +39 27 bin/node-template.coffee
  2. +9 111 npm-shrinkwrap.json
66 bin/node-template.coffee
... ... @@ -1,9 +1,10 @@
1 1 { exec } = require "child_process"
2   -path = require "path"
  2 +fs = require "fs"
  3 +path = require "path"
3 4
4   -require "colors"
5   -glob = require "glob"
6   -_ = require "underscore"
  5 +colors = require "colors"
  6 +glob = require "glob"
  7 +_ = require "underscore"
7 8
8 9 module.exports = class Bin
9 10 constructor: (options={}) ->
@@ -63,32 +64,13 @@ module.exports = class Bin
63 64 "rm test/node-template.coffee"
64 65 ]
65 66
66   - # Overwrite files to remove node-template code
67   -
68   - @overwrite =
69   - "bin/node-template": """
70   - #!/usr/bin/env node
71   -
72   - require("../lib/#{name}");
73   - """
74   - "src/node-template.coffee": """
75   - common = require './#{name}/common'
76   - async = common.async
77   - _ = common.underscore
78   - """
79   -
80   - _.each @overwrite, (body, path) ->
81   - body = body.replace(/\n/g, "\\n").replace(/"/g, "\\\"")
82   - commands.push "echo \"#{body}\" > #{path}"
83   -
84 67 @executing(commands)
85 68
86 69 exec commands.join(' && '), @catchError =>
87 70
88   - dir = if dir then "#{dir}/" else ""
89   - cwd = process.cwd()
90   -
  71 + dir = if dir then "#{dir}/" else ""
91 72 commands = []
  73 + cwd = process.cwd()
92 74
93 75 glob "#{dir}#{name}/**/node-template*", (e, paths) =>
94 76 _.each paths, (path) ->
@@ -97,12 +79,42 @@ module.exports = class Bin
97 79 @executing(commands)
98 80
99 81 exec commands.join(' && '), @catchError =>
100   - commands = [
101   - "cd #{dir}#{name}"
  82 +
  83 + commands = [ "cd #{dir}#{name}" ]
  84 +
  85 + # Overwrite files to remove node-template code
  86 +
  87 + overwrite = {}
  88 +
  89 + overwrite["bin/#{name}"] =
  90 + """
  91 + #!/usr/bin/env node
  92 +
  93 + require("../lib/#{name}");
  94 + """
  95 +
  96 + overwrite["src/#{name}.coffee"] =
  97 + """
  98 + common = require './#{name}/common'
  99 + async = common.async
  100 + _ = common.underscore
  101 + """
  102 +
  103 + _.each overwrite, (body, path) ->
  104 + if fs.existsSync("#{dir}#{name}/#{path}")
  105 + body = body.replace(/\n/g, "\\n").replace(/"/g, "\\\"")
  106 + commands.push "echo \"#{body}\" > #{path}"
  107 +
  108 + if fs.existsSync("#{dir}#{name}/src")
  109 + commands.push("coffee -o lib -c src")
  110 +
  111 + commands = commands.concat [
102 112 "cake install"
103 113 "cd #{cwd}"
104 114 ]
  115 +
105 116 @executing(commands)
  117 +
106 118 exec commands.join(' && '), ->
107 119 if options.done then options.done() else process.exit()
108 120
120 npm-shrinkwrap.json
... ... @@ -1,74 +1,12 @@
1 1 {
2 2 "name": "node-template",
3   - "version": "0.1.2",
  3 + "version": "0.1.5",
4 4 "dependencies": {
5 5 "async": {
6 6 "version": "0.1.22"
7 7 },
8   - "backbone": {
9   - "version": "0.9.2"
10   - },
11   - "connect-redis": {
12   - "version": "1.4.1",
13   - "dependencies": {
14   - "debug": {
15   - "version": "0.7.0"
16   - }
17   - }
18   - },
19   - "express": {
20   - "version": "3.0.0rc3",
21   - "dependencies": {
22   - "connect": {
23   - "version": "2.4.3",
24   - "dependencies": {
25   - "qs": {
26   - "version": "0.4.2"
27   - },
28   - "formidable": {
29   - "version": "1.0.11"
30   - },
31   - "bytes": {
32   - "version": "0.1.0"
33   - },
34   - "pause": {
35   - "version": "0.0.1"
36   - }
37   - }
38   - },
39   - "commander": {
40   - "version": "0.6.1"
41   - },
42   - "range-parser": {
43   - "version": "0.0.4"
44   - },
45   - "mkdirp": {
46   - "version": "0.3.3"
47   - },
48   - "cookie": {
49   - "version": "0.0.4"
50   - },
51   - "crc": {
52   - "version": "0.2.0"
53   - },
54   - "fresh": {
55   - "version": "0.1.0"
56   - },
57   - "methods": {
58   - "version": "0.0.1"
59   - },
60   - "send": {
61   - "version": "0.0.3",
62   - "dependencies": {
63   - "mime": {
64   - "version": "1.2.6"
65   - }
66   - }
67   - },
68   - "debug": {
69   - "version": "0.7.0"
70   - }
71   - }
  8 + "colors": {
  9 + "version": "0.6.0-1"
72 10 },
73 11 "glob": {
74 12 "version": "3.1.11",
@@ -89,60 +27,17 @@
89 27 }
90 28 }
91 29 },
92   - "nodetime": {
93   - "version": "0.4.4",
94   - "dependencies": {
95   - "agent.io": {
96   - "version": "0.1.6",
97   - "dependencies": {
98   - "request": {
99   - "version": "2.10.0"
100   - }
101   - }
102   - },
103   - "timekit": {
104   - "version": "0.1.9",
105   - "dependencies": {
106   - "bindings": {
107   - "version": "1.0.0"
108   - }
109   - }
110   - },
111   - "v8tools": {
112   - "version": "0.1.1",
113   - "dependencies": {
114   - "bindings": {
115   - "version": "1.0.0"
116   - }
117   - }
118   - }
119   - }
120   - },
121   - "redis": {
122   - "version": "0.7.2",
123   - "dependencies": {
124   - "hiredis": {
125   - "version": "0.1.14"
126   - }
127   - }
128   - },
129 30 "underscore": {
130 31 "version": "1.3.3"
131 32 },
132   - "coffee-script": {
133   - "version": "1.3.3"
134   - },
135   - "colors": {
136   - "version": "0.6.0-1"
137   - },
138 33 "chai": {
139 34 "version": "1.2.0"
140 35 },
141   - "supervisor": {
142   - "version": "0.4.1"
  36 + "coffee-script": {
  37 + "version": "1.3.3"
143 38 },
144 39 "mocha": {
145   - "version": "1.3.2",
  40 + "version": "1.4.2",
146 41 "dependencies": {
147 42 "commander": {
148 43 "version": "0.6.1"
@@ -163,6 +58,9 @@
163 58 },
164 59 "debug": {
165 60 "version": "0.7.0"
  61 + },
  62 + "mkdirp": {
  63 + "version": "0.3.3"
166 64 }
167 65 }
168 66 },

0 comments on commit 5491a29

Please sign in to comment.
Something went wrong with that request. Please try again.