generated from victorsoares96/lib-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from victorsoares96/feat/fetch-binaries-in-pos…
…tinstall ✨ feat: fetch binaries automatically in postinstall
- Loading branch information
Showing
3 changed files
with
31 additions
and
9 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,21 @@ | ||
const os = require('os'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const childProcess = require('child_process'); | ||
const util = require('util'); | ||
|
||
const exec = util.promisify(childProcess.exec); | ||
|
||
(async () => { | ||
if (fs.existsSync(path.resolve(__dirname, '../dist'))) { | ||
const fetchBinaries = require('./fetch-binaries'); | ||
const gsPath = path.resolve(__dirname, '../bin/gs'); | ||
|
||
await fetchBinaries.default(os.platform(), gsPath); | ||
|
||
if (os.platform() === 'linux') { | ||
console.log('setting permissions for binaries path'); | ||
await exec(`chmod +x ${path.resolve(gsPath, '10.01.1_linux/usr/local/bin/gs')}`); | ||
} | ||
} | ||
})(); |
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
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