Skip to content

Commit e4039e9

Browse files
committed
Fix env PATH expansion in setup workspace
1 parent 4fb7c88 commit e4039e9

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

scripts/setup-workspace.sh

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -157,23 +157,11 @@ else
157157
fi
158158

159159
log "Writing environment to $ENV_FILE"
160-
current_path="${PATH:-}"
161-
for required in /usr/bin /bin /usr/local/bin; do
162-
case ":$current_path:" in
163-
*:"$required":*) ;;
164-
*) current_path="${current_path:+$current_path:}$required" ;;
165-
esac
166-
done
167-
if [ -n "$current_path" ]; then
168-
path_suffix=":$current_path"
169-
else
170-
path_suffix=""
171-
fi
172-
cat > "$ENV_FILE" <<ENV
160+
cat > "$ENV_FILE" <<'ENV'
173161
export JAVA_HOME="$JAVA_HOME"
174162
export JAVA17_HOME="$JAVA17_HOME"
175163
export MAVEN_HOME="$MAVEN_HOME"
176-
export PATH="\$JAVA_HOME/bin:\$MAVEN_HOME/bin$path_suffix"
164+
export PATH="\$JAVA_HOME/bin:\$MAVEN_HOME/bin:\$PATH"
177165
ENV
178166

179167
log "Workspace environment file metadata"

0 commit comments

Comments
 (0)