mirror of
https://github.com/DeterminateSystems/update-flake-lock.git
synced 2025-04-21 09:20:16 +03:00
Don't cd separately
This commit is contained in:
parent
21663d562d
commit
1752965d0b
3 changed files with 11 additions and 32 deletions
20
dist/index.js
vendored
20
dist/index.js
vendored
|
@ -94310,26 +94310,16 @@ var UpdateFlakeLockAction = class {
|
|||
this.pathToFlakeDir = inputs_exports.getStringOrNull("path-to-flake-dir");
|
||||
}
|
||||
async update() {
|
||||
if (this.pathToFlakeDir !== null) {
|
||||
const returnCode = await exec.exec("cd", [this.pathToFlakeDir]);
|
||||
if (returnCode !== 0) {
|
||||
this.idslib.recordEvent(EVENT_EXECUTION_FAILURE, {
|
||||
returnCode
|
||||
});
|
||||
core.setFailed(
|
||||
`Error when trying to cd into flake directory ${this.pathToFlakeDir}. Make sure the check that the directory exists.`
|
||||
);
|
||||
}
|
||||
}
|
||||
const nixCommandArgs = makeNixCommandArgs(
|
||||
this.nixOptions,
|
||||
this.flakeInputs,
|
||||
this.commitMessage
|
||||
);
|
||||
const fullNixCommand = `nix ${nixCommandArgs.join(" ")}`;
|
||||
core.debug(`running nix command:
|
||||
${fullNixCommand}`);
|
||||
const exitCode = await exec.exec("nix", nixCommandArgs);
|
||||
const execOptions = {};
|
||||
if (this.pathToFlakeDir !== null) {
|
||||
execOptions.cwd = this.pathToFlakeDir;
|
||||
}
|
||||
const exitCode = await exec.exec("nix", nixCommandArgs, execOptions);
|
||||
if (exitCode !== 0) {
|
||||
this.idslib.recordEvent(EVENT_EXECUTION_FAILURE, {
|
||||
exitCode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue