-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from camsys/quarter1
Quarter1
- Loading branch information
Showing
45 changed files
with
2,944 additions
and
1,372 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# If checking out a branch that follows the pattern "quarter#", get its name | ||
branch=$(git reflog | awk 'NR==1{print $8; exit}' | grep 'quarter\d') | ||
|
||
# If a quarter# branch was checked out... | ||
if [ $branch ] ; then | ||
# Add a colon (:) before the branch name for proper searching | ||
branch=":${branch}" | ||
|
||
# Get the outdatedBranches (for logging purposes later) if there are any | ||
outdatedGems=$(grep -nr ':quarter\d' Gemfile) | ||
outdatedBranches=() | ||
while read -r oldBranch ; do | ||
if [ "$branch" != "$oldBranch" ] ; then | ||
outdatedBranches+=("$oldBranch") | ||
fi | ||
done < <(grep -o ':quarter\d' <<< "${outdatedGems}") | ||
|
||
# Replace all branches in the file with the new branch | ||
if [ "${outdatedBranches}" ] ; then | ||
echo -e "Your Gemfile contains the following gems which do not match your current branch:\n**********\n${outdatedGems}\n**********" | ||
|
||
sed -i '' "s/:quarter[0-9]/${branch}/g" "./Gemfile" | ||
|
||
echo "They have been updated to ${branch}." | ||
fi | ||
fi |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.