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:
@ -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";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user