lytos-cli 0.3.0 → 0.3.1
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.js +16 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
import { Command as Command3 } from "commander";
|
|
5
|
+
import { execSync } from "child_process";
|
|
5
6
|
|
|
6
7
|
// src/commands/init.ts
|
|
7
8
|
import { Command } from "commander";
|
|
@@ -1245,7 +1246,7 @@ async function checkForUpdates(currentVersion) {
|
|
|
1245
1246
|
` ${yellow("\u26A0")} Update available: ${dim(currentVersion)} \u2192 ${bold(latest)}`
|
|
1246
1247
|
);
|
|
1247
1248
|
console.error(
|
|
1248
|
-
` Run ${bold("
|
|
1249
|
+
` Run ${bold("lyt update")} to update`
|
|
1249
1250
|
);
|
|
1250
1251
|
console.error("");
|
|
1251
1252
|
}
|
|
@@ -1270,6 +1271,20 @@ program.command("status").description("Display sprint DAG in terminal (coming so
|
|
|
1270
1271
|
console.error("Coming soon. Follow https://github.com/getlytos/lytos-cli for updates.");
|
|
1271
1272
|
process.exit(0);
|
|
1272
1273
|
});
|
|
1274
|
+
program.command("update").description("Update lytos-cli to the latest version").action(() => {
|
|
1275
|
+
console.error(`
|
|
1276
|
+
${bold("Updating lytos-cli...")}
|
|
1277
|
+
`);
|
|
1278
|
+
try {
|
|
1279
|
+
execSync("npm install -g lytos-cli@latest", { stdio: "inherit" });
|
|
1280
|
+
const newVersion = execSync("lyt --version", { encoding: "utf-8" }).trim();
|
|
1281
|
+
console.error("");
|
|
1282
|
+
ok(`Updated to ${green(newVersion)}`);
|
|
1283
|
+
} catch {
|
|
1284
|
+
error("Update failed. Try manually: npm install -g lytos-cli@latest");
|
|
1285
|
+
process.exit(1);
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1273
1288
|
var VERSION = "0.2.1";
|
|
1274
1289
|
program.parse();
|
|
1275
1290
|
checkForUpdates(VERSION);
|