Skip to content

Commit

Permalink
fix init arguments parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jul 27, 2023
1 parent c95d65b commit cd02063
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { decompress } from "https://deno.land/x/[email protected]/mod.ts";

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

async function init(template = "base") {
async function init(
{ template, standalone }: { template?: string; standalone?: boolean },
_name?: string
) {
template = template || "base";
if (!template.endsWith("_pipeline")) {
template = template + "_pipeline";
}
Expand All @@ -21,7 +25,7 @@ async function init(template = "base") {
const repoName = data.github_url.split("/").pop();

const outputDir = `${repoName}-${data.version.replace("v", "")}`;
await copyDir(outputDir, ".fluentci");
await copyDir(outputDir, standalone ? "." : ".fluentci");
await Deno.remove(outputDir, { recursive: true });

return;
Expand Down
6 changes: 3 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import upgrade from "./upgrade.ts";
export async function main() {
await new Command()
.name("fluentci")
.version("0.2.5")
.version("0.2.6")
.description(
`
.
Expand All @@ -31,8 +31,8 @@ export async function main() {
"-s, --standalone",
"Initialize pipeline as standalone project, so it can be reused in other projects"
)
.action(async function (_, pipeline) {
await init(pipeline);
.action(async function (options, pipeline) {
await init(options, pipeline);
})
.command("search", "Search for reusable pipelines")
.arguments("<query:string>")
Expand Down

0 comments on commit cd02063

Please sign in to comment.