diff --git a/lib/controllers/update-controller.ts b/lib/controllers/update-controller.ts index 47d64678ad..40409a439c 100644 --- a/lib/controllers/update-controller.ts +++ b/lib/controllers/update-controller.ts @@ -88,6 +88,21 @@ export class UpdateController const projectData = this.$projectDataService.getProjectData( updateOptions.projectDir ); + + try { + // this is a preventive check to make sure the passed version exists before doing any backups, however + // the update can still fail if the specified tag doesn't exist in one of the updatableDependencies + // at this stage we only care to check a single dependency to catch invalid versions early. + await this.getVersionFromTag( + UpdateController.updatableDependencies[0].name, + updateOptions.version + ); + } catch (error) { + this.$errors.fail( + `${UpdateController.updateFailMessage} Reason is: ${error.message}` + ); + } + const backupDir = path.join( updateOptions.projectDir, UpdateController.backupFolder