mirror of
https://github.com/DeterminateSystems/update-flake-lock.git
synced 2024-12-23 13:32:07 +01:00
Construct Nix command
This commit is contained in:
parent
b1f8684b21
commit
502daa7e5e
1 changed files with 10 additions and 3 deletions
13
src/index.ts
13
src/index.ts
|
@ -3,7 +3,7 @@ import { ActionOptions, IdsToolbox, inputs } from "detsys-ts";
|
||||||
class UpdateFlakeLockAction {
|
class UpdateFlakeLockAction {
|
||||||
idslib: IdsToolbox;
|
idslib: IdsToolbox;
|
||||||
private nixOptions: string;
|
private nixOptions: string;
|
||||||
private targets: string;
|
private targets: string[];
|
||||||
private commitMessage: string;
|
private commitMessage: string;
|
||||||
private pathToFlakeDir: string;
|
private pathToFlakeDir: string;
|
||||||
|
|
||||||
|
@ -18,12 +18,19 @@ class UpdateFlakeLockAction {
|
||||||
this.idslib = new IdsToolbox(options);
|
this.idslib = new IdsToolbox(options);
|
||||||
|
|
||||||
this.nixOptions = inputs.getString("nix-options");
|
this.nixOptions = inputs.getString("nix-options");
|
||||||
this.targets = inputs.getString("inputs");
|
this.targets = inputs.getString("inputs").split(" ");
|
||||||
this.commitMessage = inputs.getString("commit-msg");
|
this.commitMessage = inputs.getString("commit-msg");
|
||||||
this.pathToFlakeDir = inputs.getString("path-to-flake-dir");
|
this.pathToFlakeDir = inputs.getString("path-to-flake-dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
async update(): Promise<void> {}
|
async update(): Promise<void> {
|
||||||
|
const inputFlags = this.targets
|
||||||
|
.map((input) => `--update-input ${input}`)
|
||||||
|
.join(" ");
|
||||||
|
const inputStr = this.targets.length > 1 ? `${inputFlags}` : undefined;
|
||||||
|
|
||||||
|
const nixCommand = `nix ${this.nixOptions} flake lock ${inputStr} --commit-lock-file --commit-lock-file-summary "${this.commitMessage}"`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function main(): void {
|
function main(): void {
|
||||||
|
|
Loading…
Reference in a new issue