Add `start-backup` script

This helps running a Signal Desktop instance from a backup (copy of profile
folder) when testing functionality such as database migrations, import/export,
etc.

Usage:
```
BACKUP=development-backup-2018-04-04 PROFILE=development ./scripts/start-backup
```

WARNING: This deletes the original profile and overwrites it with backup.
This commit is contained in:
Daniel Gasienica 2018-04-04 19:04:50 -04:00
parent 195e9b777c
commit 41ac9586eb
1 changed files with 18 additions and 0 deletions

18
scripts/start-backup Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
if [[ "$BACKUP" == "" ]]; then
echo "BACKUP environment variable is required"
exit 1
fi
if [[ "$PROFILE" == "" ]]; then
echo "PROFILE environment variable is required"
exit 1
fi
backupPath="$HOME/Library/Application Support/Signal-$BACKUP"
profilePath="$HOME/Library/Application Support/Signal-$PROFILE"
rm -rf "$profilePath" && \
cp -R "$backupPath" "$profilePath" && \
NODE_APP_INSTANCE="$PROFILE" yarn start