@rune-cli/rune 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +12 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -5,6 +5,9 @@ import { build } from "esbuild";
|
|
|
5
5
|
import { cp, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import ts from "typescript";
|
|
8
|
+
//#region package.json
|
|
9
|
+
var version = "0.0.4";
|
|
10
|
+
//#endregion
|
|
8
11
|
//#region src/manifest/generate-manifest.ts
|
|
9
12
|
const COMMAND_ENTRY_FILE = "index.ts";
|
|
10
13
|
function comparePathSegments(left, right) {
|
|
@@ -417,6 +420,12 @@ function tryParseProjectOption(argv, index) {
|
|
|
417
420
|
function isHelpFlag(token) {
|
|
418
421
|
return token === "--help" || token === "-h";
|
|
419
422
|
}
|
|
423
|
+
function isVersionFlag(token) {
|
|
424
|
+
return token === "--version" || token === "-V";
|
|
425
|
+
}
|
|
426
|
+
function getRuneVersion() {
|
|
427
|
+
return version;
|
|
428
|
+
}
|
|
420
429
|
function parseDevArgs(argv) {
|
|
421
430
|
const commandArgs = [];
|
|
422
431
|
let projectPath;
|
|
@@ -473,12 +482,14 @@ Commands:
|
|
|
473
482
|
dev Run a Rune project in development mode
|
|
474
483
|
|
|
475
484
|
Options:
|
|
476
|
-
-h, --help
|
|
485
|
+
-h, --help Show this help message
|
|
486
|
+
-V, --version Show the version number
|
|
477
487
|
`;
|
|
478
488
|
}
|
|
479
489
|
async function runRuneCli(options) {
|
|
480
490
|
const [subcommand, ...restArgs] = options.argv;
|
|
481
491
|
if (!subcommand || isHelpFlag(subcommand)) return successResult(renderRuneCliHelp());
|
|
492
|
+
if (isVersionFlag(subcommand)) return successResult(`rune v${getRuneVersion()}\n`);
|
|
482
493
|
if (subcommand === "dev") {
|
|
483
494
|
const parsedDevArgs = parseDevArgs(restArgs);
|
|
484
495
|
if ("exitCode" in parsedDevArgs) return parsedDevArgs;
|
package/package.json
CHANGED