Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/ghe-restore
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
fi

echo "Restoring Git repositories ..."
# Remove temporary 2.2 storage migration directory if it exists
echo "if [ -d /data/user/repositories-nw-backup ]; then sudo rm -rf /data/user/repositories-nw-backup; fi" |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can axe the if here too. rm -rf will exit non-zero when the directory doesn't exist.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, let's leave it. The sudo will cause problems on GHE < 2.0 and I don't think it's worth wrapping in a version check.

ghe-ssh "$GHE_HOSTNAME" -- /bin/sh 1>&3
ghe-restore-repositories-${GHE_BACKUP_STRATEGY} "$GHE_HOSTNAME" 1>&3

echo "Restoring GitHub Pages ..."
Expand Down