-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added make targets for commenting line in go.mod
- Loading branch information
林志宇
committed
Jul 1, 2019
1 parent
9b8d26b
commit 6ed2583
Showing
6 changed files
with
270 additions
and
1 deletion.
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,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ $# -ne 2 ]]; then | ||
exit 0 | ||
fi | ||
|
||
# Inputs. | ||
action=$1 | ||
filename=$2 | ||
|
||
# Line to comment/uncomment in go.mod | ||
line="replace github.com\/skycoin\/dmsg => ..\/dmsg" | ||
|
||
function print_usage() { | ||
echo $"Usage: $0 (comment|uncomment) <filename>" | ||
} | ||
|
||
case "$action" in | ||
comment) | ||
echo "commenting ${filename}..." | ||
sed -i -e "/$line/s/^\/*/\/\//" ${filename} | ||
;; | ||
uncomment) | ||
echo "uncommenting ${filename}..." | ||
sed -i -e "/$line/s/^\/\/*//" ${filename} | ||
;; | ||
help) | ||
print_usage | ||
;; | ||
*) | ||
print_usage | ||
exit 1 | ||
;; | ||
esac |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.