create-ampless 0.2.0-alpha.7 → 0.2.0-alpha.8
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/index.js +10 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1053,11 +1053,18 @@ function shortName2(opts) {
|
|
|
1053
1053
|
return basename2(opts.projectDir);
|
|
1054
1054
|
}
|
|
1055
1055
|
async function ghRepoExists(name, token) {
|
|
1056
|
-
const r = await execa2("gh", ["repo", "view", name], {
|
|
1056
|
+
const r = await execa2("gh", ["repo", "view", name, "--json", "nameWithOwner"], {
|
|
1057
1057
|
reject: false,
|
|
1058
1058
|
env: { ...process.env, GH_TOKEN: token }
|
|
1059
1059
|
});
|
|
1060
|
-
|
|
1060
|
+
if (r.exitCode !== 0) return false;
|
|
1061
|
+
try {
|
|
1062
|
+
const parsed = JSON.parse(r.stdout?.toString() ?? "{}");
|
|
1063
|
+
const resolved = parsed.nameWithOwner?.toLowerCase();
|
|
1064
|
+
return resolved === name.toLowerCase();
|
|
1065
|
+
} catch {
|
|
1066
|
+
return true;
|
|
1067
|
+
}
|
|
1061
1068
|
}
|
|
1062
1069
|
async function getOriginUrl(dir) {
|
|
1063
1070
|
const r = await execa2("git", ["remote", "get-url", "origin"], {
|
|
@@ -1490,7 +1497,7 @@ async function gatherDeployOptions(args, projectDir, projectName) {
|
|
|
1490
1497
|
githubOwner = answer.trim();
|
|
1491
1498
|
}
|
|
1492
1499
|
let githubPrivate = args.githubPrivate;
|
|
1493
|
-
if (!args.githubPrivate) {
|
|
1500
|
+
if (!args.githubPrivate && !args.skipConfirm) {
|
|
1494
1501
|
const choice = await p2.select({
|
|
1495
1502
|
message: "Repository visibility",
|
|
1496
1503
|
options: [
|