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 @@ -156,18 +156,19 @@ async function createProject(cwd: ProjectPath, options: Options) {
156156 } ) ;
157157 } ,
158158 force : async ( { results : { directory } } ) => {
159- const directoryExists = fs . existsSync ( directory ! ) ;
160- const hasNonIgnoredFiles =
161- fs . readdirSync ( directory ! ) . filter ( ( x ) => ! x . startsWith ( '.git' ) ) . length > 0 ;
162- if ( directoryExists && hasNonIgnoredFiles && options . dirCheck ) {
163- const force = await p . confirm ( {
164- message : 'Directory not empty. Continue?' ,
165- initialValue : false
166- } ) ;
167- if ( p . isCancel ( force ) || ! force ) {
168- p . cancel ( 'Exiting.' ) ;
169- process . exit ( 0 ) ;
170- }
159+ if ( ! options . dirCheck ) return ;
160+
161+ const files = fs . readdirSync ( directory ! ) ;
162+ const hasNonIgnoredFiles = files . some ( ( file ) => ! file . startsWith ( '.git' ) ) ;
163+ if ( ! hasNonIgnoredFiles ) return ;
164+
165+ const force = await p . confirm ( {
166+ message : 'Directory not empty. Continue?' ,
167+ initialValue : false
168+ } ) ;
169+ if ( p . isCancel ( force ) || ! force ) {
170+ p . cancel ( 'Exiting.' ) ;
171+ process . exit ( 0 ) ;
171172 }
172173 } ,
173174 template : ( ) => {
You can’t perform that action at this time.
0 commit comments