Permalink
Browse files

Just minify when no password is specified

  • Loading branch information...
1 parent f56172a commit 1168d4cf58cc0ad6a72b6f0f351e6963758420a5 @chriso chriso committed Dec 19, 2010
Showing with 4 additions and 9 deletions.
  1. +4 −9 lib/packnode.js
View
@@ -10,21 +10,20 @@ var cipher, data = '', encrypted, out, chunk = [],
encoding = 'base64',
algorithm = 'aes256',
chunk_length = 100,
- password, unpack, minify;
+ password, unpack;
var exit = function (msg, is_error) {
console.log(msg);
process.exit(1);
};
var usage = ''
- + '\x1b[1mUsage\x1b[0m: packnode [OPTIONS] <PASSWORD>\n'
+ + '\x1b[1mUsage\x1b[0m: packnode [OPTIONS] [PASSWORD]\n'
+ '\n'
+ '\x1b[1mExample 1\x1b[0m: cat input.js | packnode mypassword > output.js\n'
+ '\x1b[1mExample 2\x1b[0m: cat input.coffee | coffee -c -s | packnode mypassword > output.js\n'
+ '\n'
+ '\x1b[1mOptions\x1b[0m:\n'
- + ' -m, --minify Just run input through the YUI Compressor\n'
+ ' -a, --algorithm <..> Use the specified algorithm. Default is "aes256"\n'
+ ' -e, --encoding <..> Encode with base64|hex|binary. Default is "hex"\n'
+ ' -u, --unpack Unpack the module using the specified password\n'
@@ -74,10 +73,6 @@ exports.pack = function () {
case '--unpack':
unpack = true;
break;
- case '-m':
- case '--minify':
- minify = true;
- break;
case '-h':
case '--help':
exit(usage);
@@ -98,8 +93,8 @@ exports.pack = function () {
// Minify the file
min(data, function (data) {
- // Are we just minifying the file?
- if (minify) {
+ // Are we just minifying?
+ if (!password) {
process.stdout.write(data);
return;
}

0 comments on commit 1168d4c

Please sign in to comment.