Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion editors/code/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,23 @@ async function getServer(config: Config, state: PersistentState): Promise<string
});

// Patching executable if that's NixOS.
if (await fs.stat("/etc/nixos").then(_ => true).catch(_ => false)) {
if (await isNixOs()) {
await patchelf(dest);
}

await state.updateServerVersion(config.package.version);
return dest;
}

async function isNixOs(): Promise<boolean> {
try {
const contents = await fs.readFile("/etc/os-release");
return contents.indexOf("ID=nixos") !== -1;
} catch (e) {
return false;
}
}

async function downloadWithRetryDialog<T>(state: PersistentState, downloadFunc: () => Promise<T>): Promise<T> {
while (true) {
try {
Expand Down