-
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 #71 from StampyAI/issue-68-jrhender-add-diff-script
Add Diff Script
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 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
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,29 @@ | ||
#!/bin/bash | ||
|
||
# 1. Take the feature branch as the first param | ||
feature_branch=$1 | ||
|
||
# 2. Take the google doc id as the second param | ||
google_doc_id=$2 | ||
|
||
# 3. Check out the main git branch | ||
git checkout main | ||
|
||
# 4. Run the node devtool.js command and store the result | ||
main_output=$(node devtools.js md $google_doc_id) | ||
main_output_file=$(mktemp) | ||
echo "$main_output" > "$main_output_file" | ||
|
||
# 5. Check out the feature branch | ||
git checkout $feature_branch | ||
|
||
# 6. Run the same node command | ||
branch_output=$(node devtools.js md $google_doc_id) | ||
branch_output_file=$(mktemp) | ||
echo "$branch_output" > "$branch_output_file" | ||
|
||
# 7. Output a git diff of the two command runs | ||
git diff "$main_output_file" "$branch_output_file" | ||
|
||
# 8. Clean up temporary files | ||
rm "$main_output_file" "$branch_output_file" |