File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 11const hasYarn = require ( 'has-yarn' ) ;
22const Listr = require ( 'listr' ) ;
33const { catchError, throwError } = require ( 'rxjs/operators' ) ;
4+ const { existsSync } = require ( 'fs' ) ;
5+ const { join } = require ( 'path' ) ;
46const exec = require ( '../../exec' ) ;
57
8+ function hasPnpm ( ) {
9+ try {
10+ return existsSync ( join ( process . cwd ( ) , 'pnpm-lock.yaml' ) ) || existsSync ( join ( process . cwd ( ) , 'pnpm-workspace.yaml' ) ) ;
11+ } catch ( e ) {
12+ return false ;
13+ }
14+ }
15+
616module . exports = ( ) => ( {
717 title : 'Install' ,
818 task : ( ) => new Listr (
@@ -19,9 +29,17 @@ module.exports = () => ({
1929 throwError ( error ) ;
2030 } ) )
2131 } ,
32+ {
33+ title : 'Installing dependencies using pnpm' ,
34+ enabled : ( ) => hasPnpm ( ) === false ,
35+ task : ( ) => {
36+ const args = [ 'install' ] ;
37+ return exec ( 'npm' , args ) ;
38+ }
39+ } ,
2240 {
2341 title : 'Installing dependencies using npm' ,
24- enabled : ( ) => hasYarn ( ) === false ,
42+ enabled : ( ) => hasYarn ( ) === false && hasPnpm ( ) === false ,
2543 task : ( ) => {
2644 const args = [ 'install' ] ;
2745 return exec ( 'npm' , args ) ;
You can’t perform that action at this time.
0 commit comments