Archived
1
0

Detect target automatically

This removes the potential for a bad build because the native Node
modules currently can only be built on the target system, so specifying
a target for something other than the system your are building on will
not work.
This commit is contained in:
Asher
2019-08-21 11:29:28 -05:00
parent c2be0ec71b
commit 80050d0d9d
3 changed files with 21 additions and 14 deletions

View File

@ -124,11 +124,11 @@ export class UpdateService extends AbstractUpdateService {
private async buildReleaseName(release: string): Promise<string> {
let target: string = os.platform();
if (target === "linux") {
const result = await util.promisify(cp.exec)("ldd --version");
if (result.stderr) {
throw new Error(result.stderr);
}
if (result.stdout.indexOf("musl") !== -1) {
const result = await util.promisify(cp.exec)("ldd --version").catch((error) => ({
stderr: error.message,
stdout: "",
}));
if (result.stderr.indexOf("musl") !== -1 || result.stdout.indexOf("musl") !== -1) {
target = "alpine";
}
}