-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Bash Script for Modified Files (#85)
* Add Modified Files Command * Address Comments * Address Comments * Modified Files Bash Script * new line * Job Title
- Loading branch information
1 parent
e828fff
commit ab5cd77
Showing
2 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
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,23 @@ | ||
if [ -z "$BASH" ]; then | ||
echo Bash not installed. | ||
exit 1 | ||
fi | ||
git status >/dev/null 2>&1 || { echo >&2 "Not in a git directory or no git"; exit 1; } | ||
|
||
mkdir -p /tmp/swissknife | ||
touch /tmp/swissknife/modified_files.txt | ||
|
||
FILES_MODIFIED="" | ||
get_modified_files() { | ||
FILES_MODIFIED="" | ||
FILES_MODIFIED=$(git diff --name-only $(git merge-base HEAD origin/${BASE_BRANCH})..HEAD) | ||
} | ||
|
||
get_modified_files | ||
if [ -z "$FILES_MODIFIED" ] | ||
then | ||
echo "Files not modified" | ||
else | ||
echo "$FILES_MODIFIED" >> /tmp/swissknife/modified_files.txt | ||
cat /tmp/swissknife/modified_files.txt | ||
fi |
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