@rendotdev/rig 0.0.16 → 0.0.17
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/rig.js +6 -7
- package/package.json +1 -1
package/dist/rig.js
CHANGED
|
@@ -197,24 +197,23 @@ class CliApplication {
|
|
|
197
197
|
}
|
|
198
198
|
configureUpdateCommand() {
|
|
199
199
|
this.program.command("update").description("Update rig to the latest published version.").action(async () => {
|
|
200
|
+
const $ = globalThis.Bun.$;
|
|
200
201
|
const currentVersion = this.version();
|
|
201
202
|
console.log(`Current version: ${currentVersion}`);
|
|
202
203
|
console.log("Checking for updates...");
|
|
203
|
-
const result =
|
|
204
|
-
|
|
205
|
-
});
|
|
206
|
-
if (result.status !== 0) {
|
|
204
|
+
const result = await $`npm install -g @rendotdev/rig@latest --force`.quiet().nothrow();
|
|
205
|
+
if (result.exitCode !== 0) {
|
|
207
206
|
console.error("Update failed.");
|
|
208
207
|
process.exit(1);
|
|
209
208
|
}
|
|
210
|
-
const check =
|
|
211
|
-
const newVersion = check.
|
|
209
|
+
const check = await $`rig --version`.quiet().text();
|
|
210
|
+
const newVersion = check.trim();
|
|
212
211
|
if (newVersion === currentVersion) {
|
|
213
212
|
console.log(`Already on the latest version (${currentVersion}).`);
|
|
214
213
|
} else {
|
|
215
214
|
console.log(`Updated: ${currentVersion} -> ${newVersion}`);
|
|
216
215
|
}
|
|
217
|
-
|
|
216
|
+
await $`rig init`;
|
|
218
217
|
});
|
|
219
218
|
}
|
|
220
219
|
configureDevCommands() {
|