Skip to content

Commit

Permalink
cli: share toLeopard code path between leopard, leopard-zip
Browse files Browse the repository at this point in the history
  • Loading branch information
towerofnix committed Jul 1, 2024
1 parent 9b0f978 commit e493317
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ async function run() {
}
);

function toLeopard() {
return project.toLeopard();
}

switch (outputType) {
case "leopard": {
const leopard = await writeStep(`${chalk.bold("Converting")} project to ${chalk.white("Leopard")}.`, () => {
return project.toLeopard();
});
const leopard = await writeStep(`${chalk.bold("Converting")} project to ${chalk.white("Leopard")}.`, toLeopard);

const fullOutputPath = path.resolve(process.cwd(), output);

Expand Down Expand Up @@ -240,10 +242,7 @@ async function run() {
break;
}
case "leopard-zip": {
const leopard = await writeStep(`${chalk.bold("Converting")} project to ${chalk.white("Leopard")}.`, () => {
const leopard = project.toLeopard();
return leopard;
});
const leopard = await writeStep(`${chalk.bold("Converting")} project to ${chalk.white("Leopard")}.`, toLeopard);

const fullOutputPath = path.resolve(process.cwd(), output);

Expand Down

0 comments on commit e493317

Please sign in to comment.