File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const CI = Boolean(process.env.CI);
1818beforeAll ( ( ) => {
1919 if ( CI ) {
2020 // prefetch the storybook cli during ci to reduce fetching errors in tests
21- execSync ( 'pnpx create-storybook@latest --version' ) ;
21+ execSync ( 'pnpm dlx create-storybook@latest --version' ) ;
2222 }
2323} ) ;
2424
Original file line number Diff line number Diff line change @@ -142,18 +142,19 @@ async function createProject(cwd: ProjectPath, options: Options) {
142142 } ) ;
143143 } ,
144144 force : async ( { results : { directory } } ) => {
145- const directoryExists = fs . existsSync ( directory ! ) ;
146- const hasNonIgnoredFiles =
147- fs . readdirSync ( directory ! ) . filter ( ( x ) => ! x . startsWith ( '.git' ) ) . length > 0 ;
148- if ( directoryExists && hasNonIgnoredFiles && options . dirCheck ) {
149- const force = await p . confirm ( {
150- message : 'Directory not empty. Continue?' ,
151- initialValue : false
152- } ) ;
153- if ( p . isCancel ( force ) || ! force ) {
154- p . cancel ( 'Exiting.' ) ;
155- process . exit ( 0 ) ;
156- }
145+ if ( ! options . dirCheck ) return ;
146+
147+ const files = fs . readdirSync ( directory ! ) ;
148+ const hasNonIgnoredFiles = files . some ( ( file ) => ! file . startsWith ( '.git' ) ) ;
149+ if ( ! hasNonIgnoredFiles ) return ;
150+
151+ const force = await p . confirm ( {
152+ message : 'Directory not empty. Continue?' ,
153+ initialValue : false
154+ } ) ;
155+ if ( p . isCancel ( force ) || ! force ) {
156+ p . cancel ( 'Exiting.' ) ;
157+ process . exit ( 0 ) ;
157158 }
158159 } ,
159160 template : ( ) => {
You can’t perform that action at this time.
0 commit comments