Permalink
Browse files

bump for compability issues

  • Loading branch information...
1 parent 5204736 commit a25232b86abb670a49914ea98938d3525bb7016d @conancat conancat committed Jun 26, 2012
View
@@ -1,9 +1,9 @@
{spawn, exec} = require 'child_process'
-sys = require 'sys'
+util = require 'util'
printOutput = (process) ->
- process.stdout.on 'data', (data) -> sys.print data
- process.stderr.on 'data', (data) -> sys.print data
+ process.stdout.on 'data', (data) -> util.print data
+ process.stderr.on 'data', (data) -> util.print data
task 'test', 'Run execution tests for tmpl-precompile', ->
test = exec 'vows test/*.test.js'
@@ -29,7 +29,7 @@ task 'compile', 'Compiles lib and bin files', ->
task 'bin', 'Compiles executable', ->
tasks = exec '''
echo "Compiling files in bin"
- coffee -b -o bin/ -c bin/
+ coffee -b -o bin/ -c bin/*.coffee
echo "Copying bin/tmpl-precompile.js to bin/tmpl-precompile"
cp bin/tmpl-precompile.js bin/tmpl-precompile
View
@@ -1,16 +1,23 @@
#!/usr/bin/env node
;
var colors, cwd, fs, jsondir, jsonfile, match, precompile, settings;
+
jsonfile = process.argv[2] || 'tmpl-precompile.json';
+
precompile = require('../lib/tmpl-precompile').precompile;
+
fs = require('fs');
+
colors = require('../lib/colors');
+
settings = {};
+
try {
settings = JSON.parse(fs.readFileSync(jsonfile, 'utf8'));
} catch (err) {
throw "ERR:tmpl-precompile: No configuration file found in this directory.\nCurrent dir: " + (process.cwd()) + "\nFor more information, please visit: https://github.com/tauren/tmpl-precompile\n" + err;
}
+
if (settings !== {}) {
settings.args = process.argv;
settings.relative = settings.relative || true;
@@ -21,10 +28,10 @@ if (settings !== {}) {
}
if (jsonfile.indexOf('/' > 0)) {
match = jsonfile.split(/\//);
- jsondir = match.slice(0, match.length - 1).join('/');
+ jsondir = match.slice(0, (match.length - 1)).join('/');
cwd += '/' + jsondir;
}
console.log('\n\n' + 'tmpl-precompile'.bold.underline + '\n');
console.log('Using configuration file: ' + (cwd + '/' + match[match.length - 1]).underline + '\n');
precompile(settings, cwd);
-}
+}
View
@@ -1,16 +1,23 @@
#!/usr/bin/env node
;
var colors, cwd, fs, jsondir, jsonfile, match, precompile, settings;
+
jsonfile = process.argv[2] || 'tmpl-precompile.json';
+
precompile = require('../lib/tmpl-precompile').precompile;
+
fs = require('fs');
+
colors = require('../lib/colors');
+
settings = {};
+
try {
settings = JSON.parse(fs.readFileSync(jsonfile, 'utf8'));
} catch (err) {
throw "ERR:tmpl-precompile: No configuration file found in this directory.\nCurrent dir: " + (process.cwd()) + "\nFor more information, please visit: https://github.com/tauren/tmpl-precompile\n" + err;
}
+
if (settings !== {}) {
settings.args = process.argv;
settings.relative = settings.relative || true;
@@ -21,10 +28,10 @@ if (settings !== {}) {
}
if (jsonfile.indexOf('/' > 0)) {
match = jsonfile.split(/\//);
- jsondir = match.slice(0, match.length - 1).join('/');
+ jsondir = match.slice(0, (match.length - 1)).join('/');
cwd += '/' + jsondir;
}
console.log('\n\n' + 'tmpl-precompile'.bold.underline + '\n');
console.log('Using configuration file: ' + (cwd + '/' + match[match.length - 1]).underline + '\n');
precompile(settings, cwd);
-}
+}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit a25232b

Please sign in to comment.