forked from tailcallhq/tailcall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use neos code from tailcallhq#634
- Loading branch information
1 parent
d49023e
commit b6ff97b
Showing
3 changed files
with
31 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
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,27 @@ | ||
// @ts-check | ||
// @ts-ignore | ||
import { familySync, GLIBC, MUSL } from "detect-libc" | ||
import { exec } from 'child_process' | ||
import util from 'util' | ||
|
||
const execa = util.promisify(exec) | ||
const platform = process.platform | ||
const arch = process.arch | ||
|
||
const libcFamily = familySync() | ||
let libc | ||
if (platform === "win32") { | ||
libc = "-msvc" | ||
} else { | ||
libc = libcFamily === GLIBC ? "-gnu" : libcFamily === MUSL ? "-musl" : "" | ||
} | ||
|
||
const pkg = `@tailcallhq/core-${platform}-${arch}${libc}` | ||
|
||
try { | ||
// @ts-ignore | ||
const { stdout, stderr } = await execa(`npm install ${pkg}@${version} --no-save`) | ||
stderr ? console.log(stderr) : console.log(`Successfully installed optional dependency: ${pkg}`, stdout) | ||
} catch (error) { | ||
console.error(`Failed to install optional dependency: ${pkg}`, error.stderr) | ||
} |
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