@@ -22,30 +22,30 @@ const initialWorkingDir = process.cwd();
22
22
23
23
const mkCommand =
24
24
( cmd ) =>
25
- ( args , options = { } ) => {
26
- options [ 'env' ] = Object . assign (
27
- { SLS_DEBUG : 'true' } ,
28
- process . env ,
29
- options [ 'env' ]
30
- ) ;
31
- const { error, stdout, stderr, status } = crossSpawn . sync (
32
- cmd ,
33
- args ,
34
- options
25
+ ( args , options = { } ) => {
26
+ options [ 'env' ] = Object . assign (
27
+ { SLS_DEBUG : 'true' } ,
28
+ process . env ,
29
+ options [ 'env' ]
30
+ ) ;
31
+ const { error, stdout, stderr, status } = crossSpawn . sync (
32
+ cmd ,
33
+ args ,
34
+ options
35
+ ) ;
36
+ if ( error && ! options [ 'noThrow' ] ) {
37
+ console . error ( `Error running: ${ quote ( [ cmd , ...args ] ) } ` ) ; // eslint-disable-line no-console
38
+ throw error ;
39
+ }
40
+ if ( status && ! options [ 'noThrow' ] ) {
41
+ console . error ( 'STDOUT: ' , stdout . toString ( ) ) ; // eslint-disable-line no-console
42
+ console . error ( 'STDERR: ' , stderr . toString ( ) ) ; // eslint-disable-line no-console
43
+ throw new Error (
44
+ `${ quote ( [ cmd , ...args ] ) } failed with status code ${ status } `
35
45
) ;
36
- if ( error && ! options [ 'noThrow' ] ) {
37
- console . error ( `Error running: ${ quote ( [ cmd , ...args ] ) } ` ) ; // eslint-disable-line no-console
38
- throw error ;
39
- }
40
- if ( status && ! options [ 'noThrow' ] ) {
41
- console . error ( 'STDOUT: ' , stdout . toString ( ) ) ; // eslint-disable-line no-console
42
- console . error ( 'STDERR: ' , stderr . toString ( ) ) ; // eslint-disable-line no-console
43
- throw new Error (
44
- `${ quote ( [ cmd , ...args ] ) } failed with status code ${ status } `
45
- ) ;
46
- }
47
- return stdout && stdout . toString ( ) . trim ( ) ;
48
- } ;
46
+ }
47
+ return stdout && stdout . toString ( ) . trim ( ) ;
48
+ } ;
49
49
50
50
const sls = mkCommand ( 'sls' ) ;
51
51
const git = mkCommand ( 'git' ) ;
@@ -421,7 +421,7 @@ test(
421
421
) ;
422
422
t . true (
423
423
zipfiles . filter ( ( filename ) => filename . endsWith ( '__main__.py' ) ) . length >
424
- 0 ,
424
+ 0 ,
425
425
'__main__.py files are packaged'
426
426
) ;
427
427
t . end ( ) ;
@@ -1722,7 +1722,13 @@ test('py3.7 injects dependencies into `package` folder when using scaleway provi
1722
1722
npm ( [ 'i' , path ] ) ;
1723
1723
sls ( [ 'package' ] , { env : { } } ) ;
1724
1724
const zipfiles = await listZipFiles ( '.serverless/sls-py-req-test.zip' ) ;
1725
- t . true ( zipfiles . includes ( `package${ sep } flask${ sep } __init__.py` ) , 'flask is packaged' ) ;
1726
- t . true ( zipfiles . includes ( `package${ sep } boto3${ sep } __init__.py` ) , 'boto3 is packaged' ) ;
1725
+ t . true (
1726
+ zipfiles . includes ( `package${ sep } flask${ sep } __init__.py` ) ,
1727
+ 'flask is packaged'
1728
+ ) ;
1729
+ t . true (
1730
+ zipfiles . includes ( `package${ sep } boto3${ sep } __init__.py` ) ,
1731
+ 'boto3 is packaged'
1732
+ ) ;
1727
1733
t . end ( ) ;
1728
1734
} ) ;
0 commit comments