Skip to content

Commit 0e2eb65

Browse files
committed
fix install from npm: symlink lib post install
1 parent 17388b5 commit 0e2eb65

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
},
1313
"license": "ISC",
1414
"scripts": {
15-
"start": "electron main.js"
15+
"start": "electron main.js",
16+
"postinstall": "node scripts/link-lib"
1617
},
1718
"bin": {
1819
"loop-drop": "scripts/cli.js"

scripts/link-lib.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var fs = require('fs')
2+
var join = require('path').join
3+
4+
process.cwd(join(__dirname, '..'))
5+
fs.symlink(join('..','lib'), join('node_modules', 'lib'), 'dir', function(err) {
6+
if (!err) {
7+
console.log('node_modules/lib -> lib')
8+
}
9+
})

0 commit comments

Comments
 (0)