forked from holman/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dot: Move print_error_logs into a script
- Loading branch information
Showing
5 changed files
with
43 additions
and
29 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,30 @@ | ||
#!/usr/bin/env bash | ||
# Pretty print error report for failed topics | ||
|
||
source $DOT/functions/join | ||
|
||
function print_error_logs() { | ||
msg="There were some errors in: ${failing_topics[@]}" | ||
pprint fail "${msg}" | ||
joined_topics=$(join \| ${failing_topics[@]}) | ||
error_logs=$(find -E -L /tmp -maxdepth 1 -regex ".*(${joined_topics})${logfile_suffix}") | ||
for logfile in ${error_logs}; do pprint error "${logfile}"; done | ||
} | ||
|
||
function usage() { | ||
echo "usage: $0 logsuffix topic1 [topic2 ...]" | ||
echo " logsuffix: suffix of the install log file to be listed" | ||
echo " topic1, ...: list of topics that failed to install" | ||
} | ||
|
||
if [[ $# < 2 ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
logfile_suffix=$1; shift | ||
failing_topics=("$@") | ||
|
||
print_error_logs ${logfile_suffix} "${failing_topics}" | ||
pprint flush | ||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ | |
|
||
export DOT=$HOME/.dotfiles | ||
export PATH="$DOT/.dot/bin:$DOT/bin:$PATH" | ||
source $DOT/.dot/util/print_error_logs |
This file was deleted.
Oops, something went wrong.