@@ -22,58 +22,56 @@ export const getInteractiveArgs = async ({
2222 skipDepInstall,
2323 skipGitInit,
2424 template,
25- } : InteractiveArgs ) : Promise < InteractiveArgsResult > => {
26- return {
27- projectName :
28- projectName ||
25+ } : InteractiveArgs ) : Promise < InteractiveArgsResult > => ( {
26+ projectName :
27+ projectName ||
28+ checkCancel (
29+ await text ( {
30+ message : "What is the name of your project?" ,
31+ placeholder : "my-project" ,
32+ validate : validateProjectName ,
33+ } ) ,
34+ ) . toString ( ) ,
35+ skipDepInstall :
36+ skipDepInstall ||
37+ Boolean (
2938 checkCancel (
30- await text ( {
31- message : "What is the name of your project?" ,
32- placeholder : "my-project" ,
33- validate : validateProjectName ,
34- } ) ,
35- ) . toString ( ) ,
36- skipDepInstall :
37- skipDepInstall ||
38- Boolean (
39- checkCancel (
40- await confirm ( { message : "Do you want to skip installing dependencies (npm install)?" , initialValue : false } ) ,
41- ) ,
39+ await confirm ( { message : "Do you want to skip installing dependencies (npm install)?" , initialValue : false } ) ,
4240 ) ,
43- skipGitInit :
44- skipGitInit ||
45- Boolean (
46- checkCancel (
47- await confirm ( { message : "Do you want to skip initializing a git repository?" , initialValue : false } ) ,
48- ) ,
49- ) ,
50- template :
51- template ||
41+ ) ,
42+ skipGitInit :
43+ skipGitInit ||
44+ Boolean (
5245 checkCancel (
53- (
54- await group < { useCustomTemplate : boolean ; template : string } > ( {
55- useCustomTemplate : async ( ) =>
56- Boolean (
57- await confirm ( {
58- message : "Do you want to use a custom template?" ,
59- initialValue : false ,
60- } ) ,
61- ) ,
62- template : async ( { results } ) => {
63- if ( ! results . useCustomTemplate ) {
64- return "@pplancq/react-template" ;
65- }
66-
67- return (
68- await text ( {
69- message : "Enter the custom template name (e.g., @pplancq/react-template):" ,
70- placeholder : "@pplancq/react-template" ,
71- validate : validateTemplateName ,
72- } )
73- ) . toString ( ) ;
74- } ,
75- } )
76- ) . template ,
46+ await confirm ( { message : "Do you want to skip initializing a git repository?" , initialValue : false } ) ,
7747 ) ,
78- } ;
79- } ;
48+ ) ,
49+ template :
50+ template ||
51+ checkCancel (
52+ (
53+ await group < { useCustomTemplate : boolean ; template : string } > ( {
54+ useCustomTemplate : async ( ) =>
55+ Boolean (
56+ await confirm ( {
57+ message : "Do you want to use a custom template?" ,
58+ initialValue : false ,
59+ } ) ,
60+ ) ,
61+ template : async ( { results } ) => {
62+ if ( ! results . useCustomTemplate ) {
63+ return "@pplancq/react-template" ;
64+ }
65+
66+ return (
67+ await text ( {
68+ message : "Enter the custom template name (e.g., @pplancq/react-template):" ,
69+ placeholder : "@pplancq/react-template" ,
70+ validate : validateTemplateName ,
71+ } )
72+ ) . toString ( ) ;
73+ } ,
74+ } )
75+ ) . template ,
76+ ) ,
77+ } ) ;
0 commit comments