File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,15 @@ class ServerlessPlugin {
35
35
// Therefore, the filtering can be disabled to speed up (~3.2s) the process.
36
36
this . serverless . service . package . excludeDevDependencies = false ;
37
37
38
- this . artifacts = [ ] ;
38
+ // represented as an object for unique keys
39
+ this . artifacts = { } ;
39
40
}
40
41
41
42
runDocker ( funcArgs , captureOutput ) {
42
43
const defaultArgs = [
43
44
'run' ,
44
45
'--rm' ,
46
+ '-t' ,
45
47
`-v` , `${ this . servicePath } :/code` ,
46
48
`-v` , `${ process . env [ 'HOME' ] } /.cargo/registry:/root/.cargo/registry` ,
47
49
`-v` , `${ process . env [ 'HOME' ] } /.cargo/git:/root/.cargo/git` ,
@@ -78,12 +80,13 @@ class ServerlessPlugin {
78
80
const executablePath = path . resolve ( 'target/lambda/release' , crate + '.so' ) ;
79
81
const targetPath = path . resolve ( this . servicePath , crate + '.so' ) ;
80
82
copyFileSync ( executablePath , targetPath ) ;
81
- this . artifacts . push ( targetPath ) ;
83
+ // only the keys matters
84
+ this . artifacts [ targetPath ] = null ;
82
85
} )
83
86
}
84
87
85
88
clean ( ) {
86
- this . artifacts . forEach ( removeSync ) ;
89
+ Object . keys ( this . artifacts ) . forEach ( removeSync ) ;
87
90
}
88
91
}
89
92
You can’t perform that action at this time.
0 commit comments