TKKT6D4C75R7WSRJY5IWX7OJR5M6B5IWYEN5BKMVFQZTECYGWVJQC
const child = cp.spawn(path, ["--version"]);
child.stdout.on("data", (b: Buffer) => outputChannel.append(b.toString()));
return new Promise<IPijul>((resolve, reject) => {
const pathDefined = path || "pijul";
const child = cp.spawn(pathDefined || "pijul", ["--version"]);
const buffers: Buffer[] = [];
child.stdout.on("data", (b: Buffer) => buffers.push(b));
child.on("error", () => reject(new Error("Error checking version at " + path)));
child.on("close", code => {
if (code) {
reject(new Error("Error checking version at " + path));
} else {
resolve({ path: pathDefined, version: Buffer.concat(buffers).toString("utf8").trim().split(" ")[1] });
}
});
});
await checkPijulInstallation(config, outputChannel);
const installationPath = config.get<string>("installationPath");
// Make sure that the Pijul installation is valid
let identifiedInstallation = false;
let pijul;
while (!identifiedInstallation) {
try {
pijul = await checkPijulInstallation(installationPath, config, outputChannel);
outputChannel.appendLine(`Using Pijul ${pijul.version} located at ${pijul.path}`);
identifiedInstallation = true;
} catch (err) {
if (err.message === "Ignore") {
// Complete activation without finding the installation
identifiedInstallation = true;
return;
} else {
// Reset the configuration and try again
vscode.window.showErrorMessage(`Failed to find pijul installation at ${err.message.split(" ").pop()}, resetting...`);
}
}
}