mirror of
https://github.com/DeterminateSystems/nix-installer-action.git
synced 2025-01-10 22:32:06 +01:00
Tweak the warning
This commit is contained in:
parent
15d6a6a814
commit
a5bdb5e70c
3 changed files with 4 additions and 23 deletions
11
dist/index.js
vendored
11
dist/index.js
vendored
|
@ -260,21 +260,12 @@ class NixInstallerAction {
|
||||||
set_github_path() {
|
set_github_path() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Interim versions of the `nix-installer` crate may have already manipulated `$GITHUB_PATH`, as root even! Accessing that will be an error.
|
// Interim versions of the `nix-installer` crate may have already manipulated `$GITHUB_PATH`, as root even! Accessing that will be an error.
|
||||||
const github_path = process.env.GITHUB_PATH;
|
|
||||||
if (typeof github_path === "string") {
|
|
||||||
try {
|
|
||||||
(0, promises_1.access)(github_path);
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
actions_core.info("Skipping setting $GITHUB_PATH in action, as `nix-installer` crate did it already");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
actions_core.addPath("/nix/var/nix/profiles/default/bin");
|
actions_core.addPath("/nix/var/nix/profiles/default/bin");
|
||||||
actions_core.addPath(`${process.env.HOME}/.nix-profile/bin`);
|
actions_core.addPath(`${process.env.HOME}/.nix-profile/bin`);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
actions_core.error(`Attempt to set \`$GITHUB_PATH\` failed, \`nix\` may not be available on future steps: ${error}`);
|
actions_core.warning("Skipping setting $GITHUB_PATH in action, as `nix-installer` crate seems to have done this already. From `nix-installer` version 0.11.0 and up, this step is only done in the action. Prior to 0.11.0, this was done in the `nix-installer` binary.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
14
src/main.ts
14
src/main.ts
|
@ -298,22 +298,12 @@ class NixInstallerAction {
|
||||||
|
|
||||||
async set_github_path(): Promise<void> {
|
async set_github_path(): Promise<void> {
|
||||||
// Interim versions of the `nix-installer` crate may have already manipulated `$GITHUB_PATH`, as root even! Accessing that will be an error.
|
// Interim versions of the `nix-installer` crate may have already manipulated `$GITHUB_PATH`, as root even! Accessing that will be an error.
|
||||||
const github_path = process.env.GITHUB_PATH;
|
|
||||||
if (typeof github_path === "string") {
|
|
||||||
try {
|
|
||||||
access(github_path);
|
|
||||||
} catch (error) {
|
|
||||||
actions_core.info(
|
|
||||||
"Skipping setting $GITHUB_PATH in action, as `nix-installer` crate did it already",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
actions_core.addPath("/nix/var/nix/profiles/default/bin");
|
actions_core.addPath("/nix/var/nix/profiles/default/bin");
|
||||||
actions_core.addPath(`${process.env.HOME}/.nix-profile/bin`);
|
actions_core.addPath(`${process.env.HOME}/.nix-profile/bin`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
actions_core.error(
|
actions_core.warning(
|
||||||
`Attempt to set \`$GITHUB_PATH\` failed, \`nix\` may not be available on future steps: ${error}`,
|
"Skipping setting $GITHUB_PATH in action, as `nix-installer` crate seems to have done this already. From `nix-installer` version 0.11.0 and up, this step is only done in the action. Prior to 0.11.0, this was done in the `nix-installer` binary.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue