Skip to content

Commit e7d783a

Browse files
authored
Improve the CLI document and add step to confirm cleanup (#213)
1 parent 911b8a7 commit e7d783a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ sudo mv devops-toolkit-cli /usr/local/bin/
3939
Navigate to your workspace folder, then:
4040

4141
- Initialize the docker image, container and configuration directory:
42+
- If you already init before and want to re-init in new workspace, run `devops-toolkit-cli cleanup` before initialization.
4243

4344
```bash
4445
devops-toolkit-cli init
4546
# Run 'devops-toolkit-cli init vX.Y.Z' if you want to use specific version.
4647
# E.g: devops-toolkit-cli init 1.0.2
48+
4749
```
4850

4951
- Start a shell in new container:

devops-toolkit-cli

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ exec_in_container() {
9393
}
9494

9595
cleanup() {
96+
read -p "Are you sure you want to remove the container '$CONTAINER_NAME'? Type 'yes' to confirm: " confirmation
97+
if [ "$confirmation" != "yes" ]; then
98+
log $YELLOW "Cleanup aborted."
99+
return
100+
fi
96101
log $BLUE "Cleaning up..."
97102
if docker inspect --type=container "$CONTAINER_NAME" > /dev/null 2>&1; then
98103
docker stop "$CONTAINER_NAME" > /dev/null

0 commit comments

Comments
 (0)