Skip to content

Commit a714de8

Browse files
committed
https://github.com/haxtheweb/issues/issues/2471
1 parent 79e0228 commit a714de8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/create.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ async function main() {
7272
.option('--org <char>', 'organization for package.json')
7373
.option('--author <char>', 'author for site / package.json')
7474
.option('--writeHaxProperties', 'Write haxProperties for the element')
75+
.option('--force', 'force creation even if name exists in registry')
7576

7677
// options for site
7778
.option('--import-site <char>', 'URL of site to import')
@@ -224,6 +225,7 @@ async function main() {
224225
.option('--no-extras', 'skip all extra / automatic command processing')
225226
.option('--no-i', 'prevent interactions / sub-process, good for scripting')
226227
.option('--root <char>', 'root location to execute the command from')
228+
.option('--force', 'force creation even if name exists in registry')
227229
.version(packageJson.version);
228230

229231
// audit program
@@ -565,7 +567,7 @@ async function main() {
565567
return "Name must include at least one `-` and must not start or end name.";
566568
}
567569
// test that this is not an existing element we use in the registry
568-
if (results.type === "webcomponent" && wcReg[value]) {
570+
if (results.type === "webcomponent" && wcReg[value] && !commandRun.options.force) {
569571
return "Name is already a web component in the wc-registry published for HAX.";
570572
}
571573
// Check for any other syntax errors
@@ -613,7 +615,7 @@ async function main() {
613615
process.exit(1);
614616
}
615617
// test that this is not an existing element we use in the registry
616-
if (results.type === "webcomponent" && wcReg[value]) {
618+
if (results.type === "webcomponent" && wcReg[value] && !commandRun.options.force) {
617619
program.error(color.red("Name is already a web component in the wc-registry published for HAX."));
618620
process.exit(1);
619621
}

0 commit comments

Comments
 (0)