diff options
author | davidovski <david@davidovski.xyz> | 2023-06-13 00:16:21 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-06-13 00:16:21 +0100 |
commit | 2722747c090f51e12d83ba31c0f53ae34599c09c (patch) | |
tree | 0e5e13f1d7435d658193977447f8f0c410919c79 | |
parent | 60e82c6ddc7abcbc0b9c83290466dd13d8a434a9 (diff) |
use existing filename without changing ext
-rwxr-xr-x | src/shblg.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/shblg.sh b/src/shblg.sh index 226216c..af98ef5 100755 --- a/src/shblg.sh +++ b/src/shblg.sh @@ -26,6 +26,8 @@ process () { dirpath="${1%${1##*/}}" out_file="${OUTPUT_DIR}${path}" + printf "%s ...\n" "$path" + [ -d "$1" ] && { mkdir -p "$out_file" for f in "$1"/*; do @@ -35,12 +37,12 @@ process () { } || [ -x "$1" ] && { # execute the file cd $dirpath - "$1" > "${out_file%.*}.html" + "$1" > "${out_file}" cd - return 0 } || { - # just output the file as is - while IFS= read -r line; do printf "%s\n" "$line"; done < "$1" > "$out_file" + # just copy the file as is + cp "$1" "$out_file" return 0 } } |