Check for flake-dirs clash with inputs

This commit is contained in:
Luc Perkins 2024-05-23 15:55:25 -03:00
parent b6aab91cde
commit b5a9000c3f
No known key found for this signature in database
GPG key ID: 16DB1108FB591835
4 changed files with 27 additions and 7 deletions

7
dist/index.js vendored
View file

@ -94848,7 +94848,7 @@ var UpdateFlakeLockAction = class extends DetSysAction {
validateInputs() {
if (this.flakeDirs !== null && this.flakeDirs.length > 0 && this.pathToFlakeDir !== null && this.pathToFlakeDir !== "") {
throw new Error(
"Both `path-to-flake-dir` and `flake-dirs` are set, whereas only one can be set"
"Both `path-to-flake-dir` and `flake-dirs` are set, whereas only one can be"
);
}
if (this.flakeDirs !== null && this.flakeDirs.length === 0) {
@ -94856,6 +94856,11 @@ var UpdateFlakeLockAction = class extends DetSysAction {
"The `flake-dirs` input is set to an empty array; it must contain at least one directory"
);
}
if (this.flakeDirs !== null && this.flakeDirs.length > 0 && this.flakeInputs.length > 0) {
throw new Error(
`You've set both \`flake-dirs\` and \`inputs\` but you can only set one`
);
}
}
ensureDirectoryExists(flakeDir) {
core.debug(`Checking that flake directory \`${flakeDir}\` exists`);