Skip to content

Commit 7cba512

Browse files
committed
Makefile: fix restart.storage-clean
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
1 parent b207ba3 commit 7cba512

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,11 @@ env:
229229
.PHONY: restart.storage-clean
230230
restart.storage-clean:
231231
@docker-compose -f ./services/storage/docker-compose.yml down 2>&1 | tee -a docker-compose.err
232-
@$(foreach vol, \
233-
$(shell docker-compose -f services/storage/docker-compose.yml config --volumes 2>&1 | tee -a docker-compose.err),\
234-
$(call error_handler,$@ for storage_$${vol}); \,\
235-
docker volume rm storage_$(vol);)
236-
docker-compose -f ./services/storage/docker-compose.yml up -d 2>&1 | tee -a docker-compose.err
232+
vols=`docker-compose -f services/storage/docker-compose.yml config --volumes 2>&1 | tee -a docker-compose.err`
233+
if [ ! -z "$${vols}" ]; then
234+
for vol in $${vols}; do
235+
docker volume rm -f "storage_$${vol}" 2> /dev/null
236+
done
237+
fi
238+
@docker-compose -f ./services/storage/docker-compose.yml up -d 2>&1 | tee -a docker-compose.err
237239
$(call error_handler,$@);

0 commit comments

Comments
 (0)