@reporting-bi/cli 0.0.19 → 0.0.21
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/index.js +12 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9934,16 +9934,19 @@ var FLAG_ALIASES = {
|
|
|
9934
9934
|
s: "sort",
|
|
9935
9935
|
f: "filter"
|
|
9936
9936
|
};
|
|
9937
|
+
function isFlag(arg) {
|
|
9938
|
+
return arg.startsWith("-") && !/^-\d/.test(arg);
|
|
9939
|
+
}
|
|
9937
9940
|
function parseArgs(args) {
|
|
9938
9941
|
const positional = [];
|
|
9939
9942
|
const flags = {};
|
|
9940
9943
|
for (let i = 0; i < args.length; i++) {
|
|
9941
|
-
if (args[i].startsWith("--") && (i + 1 >= args.length || args[i + 1]
|
|
9944
|
+
if (args[i].startsWith("--") && (i + 1 >= args.length || isFlag(args[i + 1]))) {
|
|
9942
9945
|
flags[args[i].slice(2)] = "true";
|
|
9943
9946
|
} else if (args[i].startsWith("--") && i + 1 < args.length) {
|
|
9944
9947
|
flags[args[i].slice(2)] = args[i + 1];
|
|
9945
9948
|
i++;
|
|
9946
|
-
} else if (args[i]
|
|
9949
|
+
} else if (isFlag(args[i]) && !args[i].startsWith("--") && i + 1 < args.length) {
|
|
9947
9950
|
const key = FLAG_ALIASES[args[i].slice(1)] || args[i].slice(1);
|
|
9948
9951
|
flags[key] = args[i + 1];
|
|
9949
9952
|
i++;
|
|
@@ -34447,7 +34450,7 @@ function text(data) {
|
|
|
34447
34450
|
async function mcp() {
|
|
34448
34451
|
const server = new McpServer({
|
|
34449
34452
|
name: "reporting-bi",
|
|
34450
|
-
version: "0.0.
|
|
34453
|
+
version: "0.0.21"
|
|
34451
34454
|
});
|
|
34452
34455
|
server.tool(
|
|
34453
34456
|
"status",
|
|
@@ -34991,8 +34994,8 @@ async function checkForUpdate() {
|
|
|
34991
34994
|
saveUpdateCheck({ lastCheck: now });
|
|
34992
34995
|
const latest = await fetchLatestVersion();
|
|
34993
34996
|
if (!latest) return;
|
|
34994
|
-
if (!isNewer(latest, "0.0.
|
|
34995
|
-
console.log(`\x1B[33mUpdating ${PACKAGE_NAME} ${"0.0.
|
|
34997
|
+
if (!isNewer(latest, "0.0.21")) return;
|
|
34998
|
+
console.log(`\x1B[33mUpdating ${PACKAGE_NAME} ${"0.0.21"} \u2192 ${latest}...\x1B[0m`);
|
|
34996
34999
|
(0, import_node_child_process2.execSync)(npmInstallCmd(latest), { stdio: "inherit" });
|
|
34997
35000
|
console.log(`\x1B[32mUpdated to ${latest}.\x1B[0m`);
|
|
34998
35001
|
} catch {
|
|
@@ -35004,11 +35007,11 @@ async function forceUpdate() {
|
|
|
35004
35007
|
console.error("Could not fetch latest version from npm.");
|
|
35005
35008
|
process.exit(1);
|
|
35006
35009
|
}
|
|
35007
|
-
if (!isNewer(latest, "0.0.
|
|
35008
|
-
console.log(`Already up to date (${"0.0.
|
|
35010
|
+
if (!isNewer(latest, "0.0.21")) {
|
|
35011
|
+
console.log(`Already up to date (${"0.0.21"}).`);
|
|
35009
35012
|
return;
|
|
35010
35013
|
}
|
|
35011
|
-
console.log(`Updating ${PACKAGE_NAME} ${"0.0.
|
|
35014
|
+
console.log(`Updating ${PACKAGE_NAME} ${"0.0.21"} \u2192 ${latest}...`);
|
|
35012
35015
|
(0, import_node_child_process2.execSync)(npmInstallCmd(latest), { stdio: "inherit" });
|
|
35013
35016
|
console.log(`\x1B[32mUpdated to ${latest}.\x1B[0m`);
|
|
35014
35017
|
saveUpdateCheck({ lastCheck: Date.now() });
|
|
@@ -35146,7 +35149,7 @@ Examples:
|
|
|
35146
35149
|
(async () => {
|
|
35147
35150
|
const [command, ...args] = process.argv.slice(2);
|
|
35148
35151
|
if (command === "--version" || command === "-v") {
|
|
35149
|
-
console.log("0.0.
|
|
35152
|
+
console.log("0.0.21");
|
|
35150
35153
|
return;
|
|
35151
35154
|
}
|
|
35152
35155
|
await checkForUpdate();
|