@@ -6,26 +6,26 @@ function runCommands (hubotDirectory, options) {
6
6
options . hubotInstallationPath = options ?. hubotInstallationPath ?? 'hubot'
7
7
console . log ( 'creating hubot directory' , hubotDirectory )
8
8
try {
9
- spawnSync ( 'mkdir' , [ hubotDirectory ] , { shell : true , stdio : 'inherit' } )
9
+ File . mkdirSync ( hubotDirectory , { recursive : true } )
10
10
} catch ( error ) {
11
11
console . log ( `${ hubotDirectory } exists, continuing to the next operation.` )
12
12
}
13
13
const envFilePath = path . resolve ( process . cwd ( ) , '.env' )
14
14
process . chdir ( hubotDirectory )
15
15
16
16
let output = spawnSync ( 'npm' , [ 'init' , '-y' ] , { shell : true , stdio : 'inherit' } )
17
- console . log ( 'npm init' , output . stderr . toString ( ) )
17
+ console . log ( 'npm init' , output . stderr ? .toString ( ) ?? '' )
18
18
if ( options . hubotInstallationPath !== 'hubot' ) {
19
19
output = spawnSync ( 'npm' , [ 'pack' , `${ options . hubotInstallationPath } ` ] , { shell : true , stdio : 'inherit' } )
20
- console . log ( 'npm pack' , output . stderr . toString ( ) , output . stdout . toString ( ) )
20
+ console . log ( 'npm pack' , output . stderr ? .toString ( ) ?? '' , output . stdout ? .toString ( ) ?? '' )
21
21
const customHubotPackage = JSON . parse ( File . readFileSync ( `${ options . hubotInstallationPath } /package.json` , 'utf8' ) )
22
22
output = spawnSync ( 'npm' , [ 'i' , `${ customHubotPackage . name } -${ customHubotPackage . version } .tgz` ] , { shell : true , stdio : 'inherit' } )
23
- console . log ( `npm i ${ customHubotPackage . name } -${ customHubotPackage . version } .tgz` , output . stderr . toString ( ) , output . stdout . toString ( ) )
23
+ console . log ( `npm i ${ customHubotPackage . name } -${ customHubotPackage . version } .tgz` , output . stderr ? .toString ( ) ?? '' , output . stdout ? .toString ( ) ?? '' )
24
24
} else {
25
25
output = spawnSync ( 'npm' , [ 'i' , 'hubot@latest' ] , { shell : true , stdio : 'inherit' } )
26
26
}
27
27
output = spawnSync ( 'npm' , [ 'i' , 'hubot-help@latest' , 'hubot-rules@latest' , 'hubot-diagnostics@latest' ] . concat ( [ options . adapter ] ) . filter ( Boolean ) )
28
- console . log ( 'npm i' , output . stderr . toString ( ) , output . stdout . toString ( ) )
28
+ console . log ( 'npm i' , output . stderr ? .toString ( ) ?? '' , output . stdout ? .toString ( ) ?? '' )
29
29
30
30
File . mkdirSync ( path . join ( 'tests' , 'doubles' ) , { recursive : true } )
31
31
0 commit comments