We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
bind
prepublish
1 parent acb967d commit 54d0ff4Copy full SHA for 54d0ff4
scripts/prepublish
@@ -6,6 +6,12 @@ const fs = require('fs')
6
const TRUNCATE_DIR = 'bin'
7
8
9
+function truncateFile(file)
10
+{
11
+ fs.truncateSync(TRUNCATE_DIR+'/'+file, 0)
12
+}
13
+
14
15
// http://stackoverflow.com/a/34597104/586382
16
// NPM will run prepublish script after `npm install`
17
// (https://docs.npmjs.com/misc/scripts). This ensures that when script is
@@ -16,5 +22,5 @@ if(npm_config_argv && JSON.parse(npm_config_argv).original[0] === 'publish')
22
{
23
if(err) throw err
18
24
19
- files.forEach(fs.truncateSync.bind(fs, TRUNCATE_DIR+'/'+file, 0))
25
+ files.forEach(truncateFile)
20
26
})
0 commit comments