@@ -11,7 +11,7 @@ ${chalk.bold('graph test')} ${chalk.bold('<datasource>')} ${chalk.dim('[options]
11
11
${ chalk . dim ( 'Options:' ) }
12
12
-h, --help Show usage information
13
13
-v, --version <tag> Choose the version of the rust binary that you want to be downloaded/used
14
- -c, --coverage Run tests in coverage mode
14
+ -c, --coverage Run tests in coverage mode (works with v0.2.2 and above)
15
15
-f, --flags <flags>
16
16
`
17
17
@@ -99,8 +99,7 @@ CMD ../binary-linux-20 \${ARGS}
99
99
} )
100
100
101
101
// TODOs:
102
- // 1. Fix true/false options with gluegun.
103
- // 2. If -v/--version is passed, delete current image and build again.
102
+ // Fix true/false options with gluegun.
104
103
105
104
// Run a command to check if matchstick image already exists
106
105
exec ( 'docker images -q matchstick' , ( error , stdout , stderr ) => {
@@ -128,8 +127,14 @@ CMD ../binary-linux-20 \${ARGS}
128
127
129
128
// If a matchstick image does not exists, the command returns an empty string,
130
129
// else it'll return the image ID. Skip `docker build` if an image already exists
130
+ // If `-v/--version` is specified, delete current image(if any) and rebuild.
131
131
// Use spawn() and {stdio: 'inherit'} so we can see the logs in real time.
132
- if ( stdout === "" ) {
132
+ if ( stdout === '' || version ) {
133
+ if ( stdout !== '' && version ) {
134
+ exec ( 'docker image rm matchstick' , ( error , stdout , stderr ) => {
135
+ print . info ( chalk . bold ( `Removing matchstick image\n${ stdout } ` ) ) ;
136
+ } ) ;
137
+ }
133
138
// Build a docker image. If the process has executed successfully
134
139
// run a container from that image.
135
140
spawn (
0 commit comments