Skip to content

Commit e907ae9

Browse files
authored
Add loading state (#90)
1 parent 0712284 commit e907ae9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/application/cli/autoUpdater.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,23 @@ export class AutoUpdater {
7777
return;
7878
}
7979

80+
const notifier = this.output.notify('Updating the CLI');
81+
8082
try {
8183
await this.packageManager.updatePackage('croct', isInstalledGlobally);
8284
} catch (error) {
8385
const updateCommand = await this.packageManager.getPackageUpdateCommand('croct', isInstalledGlobally);
8486
const fullCommand = `${updateCommand.name} ${updateCommand.arguments?.join(' ')}`;
8587

86-
this.output.alert('Failed to update the Croct CLI automatically');
88+
notifier.alert('Failed to update the CLI automatically');
89+
8790
this.output.log(`Please run the command:\n\`${fullCommand}\``);
8891

8992
return;
9093
}
9194

92-
this.output.confirm('CLI updated successfully!');
95+
notifier.confirm('CLI updated successfully!');
96+
9397
this.output.inform('The new version will take effect the next time you run a command');
9498
}
9599

0 commit comments

Comments
 (0)