mirror of
https://github.com/DeterminateSystems/update-flake-lock.git
synced 2025-07-03 20:03:51 +03:00
Provide improved input handling
This commit is contained in:
parent
b5a9000c3f
commit
c16b76233e
6 changed files with 68 additions and 27 deletions
25
dist/index.js
vendored
25
dist/index.js
vendored
|
@ -94754,6 +94754,17 @@ function mungeDiagnosticEndpoint(inputUrl) {
|
|||
// EXTERNAL MODULE: external "fs"
|
||||
var external_fs_ = __nccwpck_require__(7147);
|
||||
;// CONCATENATED MODULE: ./dist/index.js
|
||||
// src/inputs.ts
|
||||
function determineFlakeDirectories(input) {
|
||||
const sepChar = /\s+/;
|
||||
const trimmed = input.trim();
|
||||
if (trimmed === "") {
|
||||
return [];
|
||||
} else {
|
||||
return trimmed.split(sepChar).map((s) => s.trim());
|
||||
}
|
||||
}
|
||||
|
||||
// src/nix.ts
|
||||
function makeNixCommandArgs(nixOptions, flakeInputs, commitMessage) {
|
||||
const flakeInputFlags = flakeInputs.flatMap((input) => [
|
||||
|
@ -94781,6 +94792,12 @@ var UpdateFlakeLockAction = class extends DetSysAction {
|
|||
this.flakeInputs = inputs_exports.getArrayOfStrings("inputs", "space");
|
||||
this.nixOptions = inputs_exports.getArrayOfStrings("nix-options", "space");
|
||||
this.pathToFlakeDir = inputs_exports.getStringOrNull("path-to-flake-dir");
|
||||
const flakeDirsInput = inputs_exports.getStringOrNull("flake-dirs");
|
||||
if (flakeDirsInput !== null) {
|
||||
this.flakeDirs = determineFlakeDirectories(flakeDirsInput);
|
||||
} else {
|
||||
this.flakeDirs = null;
|
||||
}
|
||||
this.validateInputs();
|
||||
}
|
||||
async main() {
|
||||
|
@ -94789,14 +94806,6 @@ var UpdateFlakeLockAction = class extends DetSysAction {
|
|||
// No post phase
|
||||
async post() {
|
||||
}
|
||||
get flakeDirs() {
|
||||
const flakeDirs = inputs_exports.getStringOrNull("flake-dirs");
|
||||
if (flakeDirs !== null) {
|
||||
return flakeDirs.trim().split(" ");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async updateFlakeLock() {
|
||||
if (this.flakeDirs !== null && this.flakeDirs.length > 0) {
|
||||
core.debug(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue