소스 검색

Chose between "docker-compose" and "docker compose" in confirm_remove.sh

Entaigner 1 년 전
부모
커밋
4570f6fb0e
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      confirm_remove.sh

+ 6 - 1
confirm_remove.sh

@@ -2,7 +2,12 @@
 echo "Warning: This will remove all containers and volumes, including persistent data. Do you want to continue? [Y/N]"
 read ans
 if [ "$ans" == "Y" ] || [ "$ans" == "y" ]; then
-  docker-compose down -v
+  command docker-compose 2>/dev/null
+  if [ "$?" == "0" ]; then
+    docker-compose down -v
+  else
+    docker compose down -v
+  fi
 else
   echo "Operation cancelled."
 fi