Skip to content

Commit

Permalink
Merge pull request #32 from fluentci-io/fix/wasm-pipeline-args
Browse files Browse the repository at this point in the history
fix bug on passing args to the wasm pipeline
  • Loading branch information
tsirysndr authored Apr 9, 2024
2 parents 22eebf2 + 182c01c commit 599e3d7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fluentci # Run the pipeline
fluentci --help

Usage: fluentci [pipeline] [jobs...]
Version: 0.12.2
Version: 0.12.3

Description:

Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

packages.default = pkgs.deno2nix.mkExecutable {
pname = "fluentci";
version = "0.12.2";
version = "0.12.3";

src = ./.;
lockfile = "./deno.lock";
Expand Down
20 changes: 18 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,32 @@ export async function main() {
.arguments("[pipeline:string] [jobs...:string]")
.option("-r, --reload", "Reload pipeline source cache")
.option("-w, --wasm", "Run pipeline as WebAssembly Module")
.option("-*, --* <args:string>", "Pass arguments to pipeline")
.option("-*, --* [args:string]", "Pass arguments to pipeline")
.action(function (options, pipeline, ...jobs: [string, ...Array<string>]) {
if (options.wasm) {
Deno.args.findIndex((arg) => arg === pipeline);
const args = Deno.args.slice(
Deno.args.findIndex((arg) => arg === pipeline) + 1
);
run(pipeline || ".", args, options);
return;
}
run(pipeline || ".", jobs, options);
})
.command("run", "Run a pipeline")
.arguments("<pipeline:string> [jobs...:string]")
.option("-r, --reload", "Reload pipeline source cache")
.option("-w, --wasm", "Run pipeline as WebAssembly Module")
.option("-*, --* <args:string>", "Pass arguments to pipeline")
.option("-*, --* [args:string]", "Pass arguments to pipeline")
.action(function (options, pipeline, ...jobs: [string, ...Array<string>]) {
if (options.wasm) {
Deno.args.findIndex((arg) => arg === pipeline);
const args = Deno.args.slice(
Deno.args.findIndex((arg) => arg === pipeline) + 1
);
run(pipeline, args, options);
return;
}
run(pipeline, jobs, options);
})
.command("init", "Initialize a new pipeline")
Expand Down
2 changes: 1 addition & 1 deletion src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { dir } from "../deps.ts";

export const VERSION = "0.12.2";
export const VERSION = "0.12.3";

export const BASE_URL = "https://api.fluentci.io/v1";

Expand Down

0 comments on commit 599e3d7

Please sign in to comment.