Skip to content

Commit 1ae3600

Browse files
committed
Add rever local repo helper
1 parent 2c2b444 commit 1ae3600

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

bin/revert.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
#
4+
# This script revert the fresh start script to git branch
5+
#
6+
# Source: https://github.com/evertramos/nginx-proxy-automation
7+
#
8+
9+
# Get the script name and its real file path
10+
SCRIPT_PATH="$(dirname "$(readlink -f "$0")")"
11+
SCRIPT_NAME="${0##*/}"
12+
CURRENT_PATH=$(pwd)
13+
14+
# Go to script path if not there
15+
cd "${SCRIPT_PATH}/../"
16+
17+
# Stop compose
18+
export COMPOSE_INTERACTIVE_NO_CLI=1
19+
docker compose down 2&> /dev/null || true
20+
21+
# Remove newly created files/folder
22+
sudo rm -rf ./data .env docker-compose.yml.backup_* .env.backup_* .env
23+
24+
# Restore docker-compose.yml
25+
git restore docker-compose.yml
26+
27+
echo 'Repo restored!'
28+
29+
exit 0
30+

0 commit comments

Comments
 (0)