Skip to content
Snippets Groups Projects
Commit 383bbaa2 authored by Konstantin Pavlov's avatar Konstantin Pavlov
Browse files

20-env-subst: guard against whitespaces in file/folder names

Additionally, ignore folders that could match suffixes.
parent 41e6b2c6
Branches
Tags
No related merge requests found
......@@ -16,7 +16,7 @@ auto_envsubst() {
echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable, exiting" 1>&2
return 0
fi
for template in $(find "$template_dir" -follow -name "*$suffix"); do
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
relative_path="${template#$template_dir/}"
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
......
......@@ -16,7 +16,7 @@ auto_envsubst() {
echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable, exiting" 1>&2
return 0
fi
for template in $(find "$template_dir" -follow -name "*$suffix"); do
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
relative_path="${template#$template_dir/}"
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
......
......@@ -16,7 +16,7 @@ auto_envsubst() {
echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable, exiting" 1>&2
return 0
fi
for template in $(find "$template_dir" -follow -name "*$suffix"); do
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
relative_path="${template#$template_dir/}"
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
......
......@@ -16,7 +16,7 @@ auto_envsubst() {
echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable, exiting" 1>&2
return 0
fi
for template in $(find "$template_dir" -follow -name "*$suffix"); do
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
relative_path="${template#$template_dir/}"
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
......
......@@ -16,7 +16,7 @@ auto_envsubst() {
echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable, exiting" 1>&2
return 0
fi
for template in $(find "$template_dir" -follow -name "*$suffix"); do
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
relative_path="${template#$template_dir/}"
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
......
......@@ -16,7 +16,7 @@ auto_envsubst() {
echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable, exiting" 1>&2
return 0
fi
for template in $(find "$template_dir" -follow -name "*$suffix"); do
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
relative_path="${template#$template_dir/}"
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
......
......@@ -16,7 +16,7 @@ auto_envsubst() {
echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable, exiting" 1>&2
return 0
fi
for template in $(find "$template_dir" -follow -name "*$suffix"); do
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
relative_path="${template#$template_dir/}"
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
......
......@@ -16,7 +16,7 @@ auto_envsubst() {
echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable, exiting" 1>&2
return 0
fi
for template in $(find "$template_dir" -follow -name "*$suffix"); do
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
relative_path="${template#$template_dir/}"
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment