Skip to content

Conversation

snh
Copy link
Member

@snh snh commented Mar 30, 2016

Currently we change the working directory to the root backup-utils directory in each script. A number of scripts, such as ghe-backup-config, assume and therefore depend on this being the case.

This PR removes this, and instead sets GHE_BACKUP_ROOT to the root directory of backup-utils and uses this when referencing other scripts and files, instead of assuming the working directory is the root backup-utils directory.

Depends on #189 for the tests to pass.

/cc @github/backup-utils

@@ -1,22 +1,23 @@
#!/usr/bin/env bash
#!/bin/sh
Copy link
Member

Choose a reason for hiding this comment

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

#!/usr/bin/env bash ?

version_info="$BACKUP_UTILS_VERSION"
ref=$(git rev-parse HEAD || true)
ref=$(git --git-dir=$GHE_BACKUP_ROOT/.git rev-parse HEAD || true)
Copy link
Member Author

Choose a reason for hiding this comment

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

I used --git-dir here instead of -C to ensure the greatest backwards compatibility with Git.

@rubiojr
Copy link
Member

rubiojr commented Apr 15, 2016

@snh neat, looks good to me ✨

@rubiojr
Copy link
Member

rubiojr commented Apr 18, 2016

:shipit:

@snh snh merged commit d32a6f0 into master Apr 18, 2016
@snh snh deleted the snh/working-dir branch April 18, 2016 23:18
@snh snh restored the snh/working-dir branch April 19, 2016 23:30
zachary-mark pushed a commit that referenced this pull request May 3, 2021
Add support for both ghe-redis-cli and redis-cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants