Skip to content

Commit dfd9cc3

Browse files
committed
fix: docker.sh could not rm a stopped container
We make use of 'docker ps's filtering and quiet output: it will only print the ID of the container if there is a container that starts with $container_name
1 parent 268b355 commit dfd9cc3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ run()
6868

6969
rm()
7070
{
71-
docker kill "$container_name"
71+
[ "$(docker ps -q -f "name=$container_name")" ] && docker kill "$container_name"
7272
docker container rm "$container_name"
7373
}
7474

0 commit comments

Comments
 (0)