Skip to content

Commit

Permalink
Rename existing ipc folder with timestamp instead of deleting it
Browse files Browse the repository at this point in the history
  • Loading branch information
fridrik01 committed Apr 22, 2024
1 parent 189b072 commit 9841ec3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/deploy_subnet_under_calibration_net/prepare_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@

set -eo pipefail

read -p "Warning, this will erase your ~/.ipc folder, continue (y/n)?"
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
if [ -d ~/.ipc ]; then
TIMESTAMP=$(date +%s)
echo "Warning: an existing ~/.ipc folder already exists!"
echo "Renaming ~/.ipc to ~/.ipc.$TIMESTAMP for backup"
mv ~/.ipc ~/.ipc.$TIMESTAMP
fi

SCRIPT_DIR=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
Expand All @@ -23,9 +25,6 @@ echo "SCRIPT_DIR: $SCRIPT_DIR"
echo "Installing dependencies..."
cargo install toml-cli

echo "Removing existing .ipc folder"
rm -rf ~/.ipc

echo "Copying new .ipc folder"
cp -r $SCRIPT_DIR/.ipc ~/.ipc

Expand Down

0 comments on commit 9841ec3

Please sign in to comment.