| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | 3 | set -euo pipefail | |
| 4 | 4 | ||
| 5 | + # Found directives are delimited by : to make this script failsafe, | ||
| 6 | + # if the repository working copy is cloned into a directory which | ||
| 7 | + # contains white spaces in the file name. | ||
| 5 | 8 | # This find construct is based on https://stackoverflow.com/questions/4210042/how-to-exclude-a-directory-in-find-command/4210072#4210072 | |
| 6 | 9 | PACKAGE_JSON_LIST=$(find "$PROJECT_DIR" \( \ | |
| 7 | 10 | -name .git -o \ | |
@@ -24,6 +27,7 @@ PACKAGE_JSON_LIST=$(find "$PROJECT_DIR" \( \ | |||
| 24 | 27 | -exec printf '%s:' {} + | sed '$s/:$/\n/') | |
| 25 | 28 | # Print each path w/o newline but w/ : appended and then remove the last : with sed. | |
| 26 | 29 | ||
| 30 | + # We split on colon instead of any white space in the for loop. | ||
| 27 | 31 | IFS=':' | |
| 28 | 32 | for package in $PACKAGE_JSON_LIST; do | |
| 29 | 33 | echo "- ${package}" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments