Skip to content

Commit

Permalink
SC-9184: Force argument for docker/sdk prune (#309)
Browse files Browse the repository at this point in the history
* Adjusted prune command with force argument

* fixed typo
  • Loading branch information
zyuzka authored May 2, 2022
1 parent f2e5aa1 commit c55f507
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bin/command/internal/prune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@
Registry::addCommand "prune" "Command::prune"

function Command::prune() {
local forceArg=${1}

if [ "${forceArg}" == "--f" ]; then
forceArg='-f'
else
forceArg=''
fi

Compose::down
sync clean # TODO deprecated, use Registry::Flow::addAfterDown in mounts
Console::error "This will delete ALL docker images and volumes on the host."
docker image prune
docker volume prune
docker system prune -a
docker builder prune -a
docker image prune ${forceArg}
docker volume prune ${forceArg}
docker system prune -a ${forceArg}
docker builder prune -a ${forceArg}

return "${TRUE}"
}

0 comments on commit c55f507

Please sign in to comment.