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
88import { dirname , join } from "../../../src/deno_ral/path.ts" ;
99import { 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" ;
1213import { buildFilter } from "./package-filters.ts" ;
1314import { bundle } from "../util/deno.ts" ;
1415import { info } from "../../../src/deno_ral/log.ts" ;
@@ -22,6 +23,7 @@ Dependency,
2223import { copyQuartoScript } from "./configure.ts" ;
2324import { deno } from "./dependencies/deno.ts" ;
2425import { buildQuartoPreviewJs } from "../../../src/core/previewjs.ts" ;
26+ import { PackageCommand } from "../cmd/pkg-cmd.ts" ;
2527
2628export 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