From 41ac9586eb09c478e831d54c5a0e2cfdcccdf861 Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Wed, 4 Apr 2018 19:04:50 -0400 Subject: [PATCH] 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. --- scripts/start-backup | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/start-backup diff --git a/scripts/start-backup b/scripts/start-backup new file mode 100755 index 000000000..f42bf6e7a --- /dev/null +++ b/scripts/start-backup @@ -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