Skip to content

Commit 346b4d1

Browse files
committed
Migrate PrepareDistCommand from cliffy to clipanion
1 parent de2012b commit 346b4d1

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

package/src/common/prepare-dist.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
/*
22
* prepare-dist.ts
33
*
4-
* Copyright (C) 2020-2022 Posit Software, PBC
4+
* Copyright (C) 2020-2024 Posit Software, PBC
55
*
66
*/
77

88
import { dirname, join } from "../../../src/deno_ral/path.ts";
99
import { copySync, ensureDirSync, existsSync } from "../../../src/deno_ral/fs.ts";
10+
import { Command } from "npm:clipanion";
1011

11-
import { Configuration } from "../common/config.ts";
12+
import { Configuration } from "./config.ts";
1213
import { buildFilter } from "./package-filters.ts";
1314
import { bundle } from "../util/deno.ts";
1415
import { info } from "../../../src/deno_ral/log.ts";
@@ -22,6 +23,7 @@ Dependency,
2223
import { copyQuartoScript } from "./configure.ts";
2324
import { deno } from "./dependencies/deno.ts";
2425
import { buildQuartoPreviewJs } from "../../../src/core/previewjs.ts";
26+
import { PackageCommand } from "../cmd/pkg-cmd.ts";
2527

2628
export async function prepareDist(
2729
config: Configuration,
@@ -266,3 +268,16 @@ function inlineFilters(config: Configuration) {
266268

267269

268270
}
271+
272+
export class PrepareDistCommand extends PackageCommand {
273+
static paths = [["prepare-dist"]];
274+
275+
static usage = Command.Usage({
276+
description: "Prepares the distribution directory for packaging.",
277+
});
278+
279+
async execute() {
280+
await super.execute();
281+
await prepareDist(this.config)
282+
}
283+
}

0 commit comments

Comments
 (0)