File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
apache-maven/src/assembly/maven/bin Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -168,13 +168,12 @@ find_file_argument_basedir() {
168
168
# concatenates all lines of a file and replaces variables
169
169
concat_lines () {
170
170
if [ -f " $1 " ]; then
171
- # First replace variables in the content
172
- while IFS= read -r line || [ -n " $line " ]; do
173
- # Replace both ${MAVEN_PROJECTBASEDIR} and $MAVEN_PROJECTBASEDIR with actual value
174
- line=${line// \$\{ MAVEN_PROJECTBASEDIR\} / $MAVEN_PROJECTBASEDIR }
175
- line=${line// \$ MAVEN_PROJECTBASEDIR/ $MAVEN_PROJECTBASEDIR }
176
- echo " $line "
177
- done < " $1 " | tr -s ' \r\n' ' '
171
+ # First transform line endings to spaces
172
+ content=` tr -s ' \r\n' ' ' < " $1 " `
173
+ # Then do variable substitution on the single line
174
+ content=${content// \$\{ MAVEN_PROJECTBASEDIR\} / $MAVEN_PROJECTBASEDIR }
175
+ content=${content// \$ MAVEN_PROJECTBASEDIR/ $MAVEN_PROJECTBASEDIR }
176
+ echo " $content "
178
177
fi
179
178
}
180
179
You can’t perform that action at this time.
0 commit comments