diff options
author | typebrook <typebrook@gmail.com> | 2020-05-16 11:39:56 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-05-16 11:39:56 +0800 |
commit | 30c961b00d876e10310d95b83f891b94193c5f9d (patch) | |
tree | 16951d5a2dd6167c95edfc792a2688027dc3551c | |
parent | 2be80ffa48ec4422c108956cebec96f53e9f7986 (diff) |
Simplify the way to print temp files
-rwxr-xr-x | gist | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -77,7 +77,7 @@ set -o pipefail | |||
77 | 77 | ||
78 | # clean temporary files | 78 | # clean temporary files |
79 | tmp_dir=$(mktemp -d) | 79 | tmp_dir=$(mktemp -d) |
80 | trap "[[ '$DEBUG' == 'true' ]] && find $tmp_dir -type f | xargs tail -n +1 > log; rm -r $tmp_dir" EXIT | 80 | trap "[[ '$DEBUG' == 'true' ]] && tail -n +1 $tmp_dir/* >log 2>/dev/null; rm -r $tmp_dir" EXIT |
81 | 81 | ||
82 | # Mac compatibility | 82 | # Mac compatibility |
83 | tmp_file() { | 83 | tmp_file() { |