File tree 2 files changed +11
-11
lines changed
2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -17,17 +17,11 @@ export const dependencies = async ({where}: PopulateInput) => {
17
17
try {
18
18
const pm = whichPMRuns ( ) ;
19
19
20
- const args = [
21
- 'install' ,
22
- ...( nonNullish ( where ) && where !== '' ? [ '--prefix' , where ?? '' ] : [ ] )
23
- ] ;
24
-
25
- console . log ( pm , args ) ;
26
-
27
20
await spawn ( {
28
21
command : pm ,
29
- args,
30
- silentOut : true
22
+ args : [ 'install' ] ,
23
+ silentOut : true ,
24
+ ...( nonNullish ( where ) && where !== '' && { cwd : where } )
31
25
} ) ;
32
26
} finally {
33
27
spinner . stop ( ) ;
Original file line number Diff line number Diff line change
1
+ import { nonNullish } from '@junobuild/utils' ;
1
2
import {
2
3
spawn as spawnCommand ,
3
4
type ChildProcess ,
@@ -11,16 +12,21 @@ export const spawn = async ({
11
12
args,
12
13
stdout,
13
14
silentOut = false ,
14
- silentErrors = false
15
+ silentErrors = false ,
16
+ cwd
15
17
} : {
16
18
command : string ;
19
+ cwd ?: string ;
17
20
args ?: readonly string [ ] ;
18
21
stdout ?: ( output : string ) => void ;
19
22
silentOut ?: boolean ;
20
23
silentErrors ?: boolean ;
21
24
} ) : Promise < number | null > => {
22
25
return await new Promise < number | null > ( ( resolve , reject ) => {
23
- const process : ChildProcessWithoutNullStreams = spawnCommand ( command , args , { shell : true } ) ;
26
+ const process : ChildProcessWithoutNullStreams = spawnCommand ( command , args , {
27
+ shell : true ,
28
+ ...( nonNullish ( cwd ) && { cwd} )
29
+ } ) ;
24
30
25
31
process . stdout . on ( 'data' , ( data ) => {
26
32
if ( stdout !== null && stdout !== undefined ) {
You can’t perform that action at this time.
0 commit comments