-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: making build be platform-independent
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var fs = require('fs') | ||
var resolve = require('path').resolve | ||
var join = require('path').join | ||
var cp = require('child_process') | ||
var os = require('os') | ||
|
||
// get library path | ||
var lib = resolve(__dirname, 'node_modules', 'turndown'); | ||
|
||
// ensure path has package.json | ||
if (!fs.existsSync(join(lib, 'package.json'))) return | ||
|
||
// npm binary based on OS | ||
var npmCmd = os.platform().startsWith('win') ? 'npm.cmd' : 'npm' | ||
|
||
// install folder | ||
cp.execSync(`${npmCmd} i`, { cwd: lib, stdio: 'inherit' }) | ||
cp.execSync(`${npmCmd} run build`, { cwd: lib, stdio: 'inherit' }) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters