This commit is contained in:
Dan Motzenbecker 2015-08-21 23:45:42 -04:00
commit a5ae5e656e
2 changed files with 30 additions and 0 deletions

4
index.js Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env node
require('coffee-script/register');
require('./main');

26
main.coffee Normal file
View File

@ -0,0 +1,26 @@
fs = require 'fs'
crypto = require 'crypto'
{execSync} = require 'child_process'
resources = __dirname + '/resources/'
binPath = __dirname + '/node_modules/.bin/'
camelRx = /([a-z])([A-Z])/g
projNameRx = /\$PROJECT_NAME\$/g
projNameHyphRx = /\$PROJECT_NAME_HYPHENATED\$/g
projNameUnderRx = /\$PROJECT_NAME_UNDERSCORED\$/g
log = (s) ->
console.log "\x1b[32m#{ s }...\x1b[0m"
logErr = (err) ->
console.error "\x1b[31m#{ err }\x1b[0m"
editSync = (path, pairs) ->
fs.writeFileSync path, pairs.reduce (contents, [rx, replacement]) ->
contents.replace rx, replacement
, fs.readFileSync path, encoding: 'ascii'
init = (projName) ->