Skip to content

Commit 684fac6

Browse files
committedMar 5, 2018
Make sure the bin script uses LF
1 parent b09f7f2 commit 684fac6

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed
 

‎.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin/bcrypt text eol=lf

‎bin/bcrypt

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
#!/usr/bin/env node
22

33
var path = require("path"),
4-
bcrypt = require(path.join(__dirname, '..', 'index.js')),
5-
pkg = require(path.join(__dirname, '..', 'package.json'));
4+
bcrypt = require("../index.js"),
5+
pkg = require("../package.json");
66

77
if (process.argv.length < 3) {
8-
process.stderr.write([ // No dependencies, so we do it from hand.
8+
process.stderr.write([
99
"",
1010
" |_ _ _ _ |_",
11-
" |_)(_| \\/|_)|_ v"+pkg['version']+" (c) "+pkg['author'],
11+
" |_)(_| \\/|_)|_.js v" + pkg['version'],
1212
" / | "
13-
].join('\n')+'\n\n'+" Usage: "+path.basename(process.argv[1])+" <input> [rounds|salt]\n");
13+
].join('\n')+'\n\n'+" Usage: " + path.basename(process.argv[1]) + " <input> [rounds|salt]\n");
1414
process.exit(1);
1515
} else {
1616
var salt;
1717
if (process.argv.length > 3) {
1818
salt = process.argv[3];
1919
var rounds = parseInt(salt, 10);
20-
if (rounds == salt)
20+
if (rounds == salt) {
2121
salt = bcrypt.genSaltSync(rounds);
22-
} else
22+
}
23+
} else {
2324
salt = bcrypt.genSaltSync();
24-
process.stdout.write(bcrypt.hashSync(process.argv[2], salt)+"\n");
25+
}
26+
process.stdout.write(bcrypt.hashSync(process.argv[2], salt) + "\n");
2527
}

0 commit comments

Comments
 (0)
Please sign in to comment.