From eaff0197480d20978d06d1e4713040fb358a556a Mon Sep 17 00:00:00 2001 From: "lcxfs1991@gmail.com" Date: Wed, 22 Jun 2016 23:41:45 +0800 Subject: [PATCH] try to add postinstall --- .gitignore | 0 README.md | 0 bin/postinstall.js | 13 +++++++++++++ libs/SteamerErrWarning.js | 0 libs/SteamerLogger.js | 0 package.json | 2 +- 6 files changed, 14 insertions(+), 1 deletion(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 README.md create mode 100644 bin/postinstall.js mode change 100644 => 100755 libs/SteamerErrWarning.js mode change 100644 => 100755 libs/SteamerLogger.js mode change 100644 => 100755 package.json diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/bin/postinstall.js b/bin/postinstall.js new file mode 100644 index 0000000..b21cd6f --- /dev/null +++ b/bin/postinstall.js @@ -0,0 +1,13 @@ +const execSync = require('child_process').execSync, + os = require('os'); + + +switch(os.type()) { + case 'Darwin': + case 'Linux': + execSync('npm link'); + break; + case 'Windows_NT': + execSync('npm link'); + break; +} \ No newline at end of file diff --git a/libs/SteamerErrWarning.js b/libs/SteamerErrWarning.js old mode 100644 new mode 100755 diff --git a/libs/SteamerLogger.js b/libs/SteamerLogger.js old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 index d807c0b..3bf8a57 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "steamer", "main": "index.js", "scripts": { - "postinstall": "npm link" + "postinstall": "node ./bin/postinstall.js" }, "bin": { "steamer": "./bin/steamer.js"