mirror of http://git.davidovski.xyz/shblg.git
use existing filename without changing ext
This commit is contained in:
parent
60e82c6ddc
commit
2722747c09
|
@ -26,6 +26,8 @@ process () {
|
||||||
dirpath="${1%${1##*/}}"
|
dirpath="${1%${1##*/}}"
|
||||||
out_file="${OUTPUT_DIR}${path}"
|
out_file="${OUTPUT_DIR}${path}"
|
||||||
|
|
||||||
|
printf "%s ...\n" "$path"
|
||||||
|
|
||||||
[ -d "$1" ] && {
|
[ -d "$1" ] && {
|
||||||
mkdir -p "$out_file"
|
mkdir -p "$out_file"
|
||||||
for f in "$1"/*; do
|
for f in "$1"/*; do
|
||||||
|
@ -35,12 +37,12 @@ process () {
|
||||||
} || [ -x "$1" ] && {
|
} || [ -x "$1" ] && {
|
||||||
# execute the file
|
# execute the file
|
||||||
cd $dirpath
|
cd $dirpath
|
||||||
"$1" > "${out_file%.*}.html"
|
"$1" > "${out_file}"
|
||||||
cd -
|
cd -
|
||||||
return 0
|
return 0
|
||||||
} || {
|
} || {
|
||||||
# just output the file as is
|
# just copy the file as is
|
||||||
while IFS= read -r line; do printf "%s\n" "$line"; done < "$1" > "$out_file"
|
cp "$1" "$out_file"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue