Skip to content

Commit f6dfd11

Browse files
used path module for joining paths
1 parent 1ab8c3a commit f6dfd11

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/copyhooks.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
const fs = require('fs');
1+
const fs = require('fs');
2+
const path = require('path');
23

34
const srcDir = './hooks/';
45
const dstDir = './.git/hooks/'
56

67
fs.readdirSync(srcDir).forEach(file => {
7-
srcFile = srcDir + "/" + file;
8-
dstFile = dstDir + "/" + file;
8+
srcFile = path.join(srcDir, file);
9+
dstFile = path.join(dstDir, file);
910
fs.createReadStream(srcFile).pipe(fs.createWriteStream(dstFile));
1011
fs.chmodSync(srcFile , '755');
1112
});

0 commit comments

Comments
 (0)