diff --git a/functions/update_peertube.fish b/functions/update_peertube.fish index 44fe44a..5c5e8d8 100644 --- a/functions/update_peertube.fish +++ b/functions/update_peertube.fish @@ -23,14 +23,6 @@ function update_peertube set -g BACKUP_PATH "$BACKUP_DIR/sql-peertube_prod-"(date -Im)".bak" echo_progress "Backup path will be: " echo_highlight "$BACKUP_PATH" \n - - if not test -d "$BACKUP_DIR" - echo_progress "Creating backup dir..." \n - mkdir -p backup - end - - echo_progress "Dumping the database to the backup dir..." - pg_dump -F custom "peertube_prod" > "$BACKUP_PATH" set -g LATEST (curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) echo_progress "Updating to Peertube " @@ -38,6 +30,12 @@ function update_peertube confirm + echo_progress "Creating backup dir..." \n + mkdir -p "$BACKUP_DIR" + + echo_progress "Dumping the database to the backup dir..." + pg_dump -F custom "peertube_prod" > "$BACKUP_PATH" + set -g VERSIONS_DIR "$INSTALL_DIR/versions" echo_progress "Versions dir is: " echo_highlight "$VERSIONS_DIR" \n