Skip to content

Commit 1ba9008

Browse files
committed
prompt user whether they want to publish public or private repo
1 parent 13eb2ea commit 1ba9008

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.changeset/twelve-seas-smell.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'create-expo-stack': patch
3+
'rn-new': patch
4+
---
5+
6+
prompt user whether they want to publish public or private repo"

cli/src/utilities/publishToGitHub.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,18 @@ export const publishToGitHub = async (toolbox: GluegunToolbox, projectName: stri
9494
return null;
9595
}
9696

97+
// Ask user if they want the repository to be public or private
98+
const visibilityResponse = await toolbox.prompt.ask({
99+
type: 'select',
100+
name: 'visibility',
101+
message: 'Would you like the repository to be public or private?',
102+
choices: ['public', 'private']
103+
});
104+
97105
// Creating a new Github repository
98106
info('\nCreating new repository...');
99107
try {
100-
execSync(`gh repo create ${projectName} --public`, { stdio: 'pipe' });
108+
execSync(`gh repo create ${projectName} --${visibilityResponse.visibility}`, { stdio: 'pipe' });
101109
} catch (e) {
102110
error('\nFailed to create new repository.');
103111
return null;

0 commit comments

Comments
 (0)