Skip to content

Commit

Permalink
Relaxed repo URI validation. (#5698)
Browse files Browse the repository at this point in the history
* Relaxed repo URI validation.

* Added changelog entry.
  • Loading branch information
apascal07 committed Apr 17, 2023
1 parent cfad0cc commit 4cc49d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Relaxed repo URI validation in ext:dev:publish (#5698).
30 changes: 4 additions & 26 deletions src/extensions/extensionsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,33 +604,11 @@ export async function publishExtensionVersionFromRemoteRepo(args: {
throw new FirebaseError("Repo URI is required but not currently set.");
}
}
if (extension?.repoUri && extension.repoUri !== repoUri) {
throw new FirebaseError(
`Repo URI '${clc.bold(args.repoUri)}' does not match repo URI '${clc.bold(
extension.repoUri!
)}' already associated with Extension ${clc.bold(extensionRef)}. Repo URI cannot be changed.`
);
}
if (!extension?.repoUri) {
logger.info(
`\n${clc.red("Warning:")} You are about to associate repo URI ${clc.bold(
repoUri
)} with Extension ${clc.bold(
extensionRef
)}. This cannot be changed. All future verifiable versions must be published from this repo. ` +
`You can continue publishing unverifiable versions from local source.`
);
const confirmed = await confirm({
nonInteractive: args.nonInteractive,
force: args.force,
default: false,
});
if (!confirmed) {
return;
}
} else {
if (extension?.repoUri) {
logger.info(
`Extension ${clc.bold(extensionRef)} is published from ${clc.bold(extension?.repoUri)}.`
`Extension ${clc.bold(extensionRef)} is published from ${clc.bold(
extension?.repoUri
)}. Use --repo to change this repo.`
);
}

Expand Down

0 comments on commit 4cc49d4

Please sign in to comment.