Skip to content

Commit

Permalink
Make sure the bin script uses LF
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Mar 5, 2018
1 parent b09f7f2 commit 684fac6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/bcrypt text eol=lf
18 changes: 10 additions & 8 deletions bin/bcrypt
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#!/usr/bin/env node

var path = require("path"),
bcrypt = require(path.join(__dirname, '..', 'index.js')),
pkg = require(path.join(__dirname, '..', 'package.json'));
bcrypt = require("../index.js"),
pkg = require("../package.json");

if (process.argv.length < 3) {
process.stderr.write([ // No dependencies, so we do it from hand.
process.stderr.write([
"",
" |_ _ _ _ |_",
" |_)(_| \\/|_)|_ v"+pkg['version']+" (c) "+pkg['author'],
" |_)(_| \\/|_)|_.js v" + pkg['version'],
" / | "
].join('\n')+'\n\n'+" Usage: "+path.basename(process.argv[1])+" <input> [rounds|salt]\n");
].join('\n')+'\n\n'+" Usage: " + path.basename(process.argv[1]) + " <input> [rounds|salt]\n");
process.exit(1);
} else {
var salt;
if (process.argv.length > 3) {
salt = process.argv[3];
var rounds = parseInt(salt, 10);
if (rounds == salt)
if (rounds == salt) {
salt = bcrypt.genSaltSync(rounds);
} else
}
} else {
salt = bcrypt.genSaltSync();
process.stdout.write(bcrypt.hashSync(process.argv[2], salt)+"\n");
}
process.stdout.write(bcrypt.hashSync(process.argv[2], salt) + "\n");
}

0 comments on commit 684fac6

Please sign in to comment.