Skip to content

Commit

Permalink
A few changes to allow for compilation with pkg.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhotmann committed Nov 21, 2017
1 parent a890396 commit 43d85a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ npm-debug.log

# test directory
test

# bin directory
bin/*.*
3 changes: 2 additions & 1 deletion bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const argv = yargs
.argv;

const userReplacements = os.homedir() + '/.rename/replacements.js';
const compiled = (argv['$0'] && argv['$0'].indexOf('rname.exe') > -1);

// check if ~/.rename/replacements.js exists, if not create it and
// then copy in the text from ./userReplacements.js
Expand Down Expand Up @@ -64,7 +65,7 @@ function parseArgs() {
require('./lib/wizard')();
} else if (argv._.length > 1) { // proceed to do the rename
renameFiles();
} else if (argv._.length === 0) {
} else if (argv._.length === 0 && !compiled) {
require('./lib/rename');
} else {
console.log('ERROR: Not enough arguments specified. Type rename -h for help');
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"rname": "./bin.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "pkg -o bin\\rname -t node9-win-x64 ."
},
"author": "Jordan Hotmann",
"license": "MIT",
Expand All @@ -35,5 +36,8 @@
"prompt-sync": "^4.1.4",
"remark": "^8.0.0",
"yargs": "^8.0.2"
},
"pkg": {
"assets": "lib/userReplacements.js"
}
}

0 comments on commit 43d85a5

Please sign in to comment.