File tree Expand file tree Collapse file tree
buildSrc/src/main/java/org/jackhuang/hmcl/gradle/pack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,13 +265,17 @@ private String getLauncherScript() {
265265 return """
266266 #!/usr/bin/env bash
267267 cd "$HOME"
268- if [ -z "${HMCL_USER_HOME+x}" ]; then
269- export HMCL_USER_HOME="$HOME/.local/share/hmcl"
268+ if [ -z "${HMCL_USER_HOME:-}" ]; then
269+ if [ -z "${XDG_DATA_HOME:-}" ]; then
270+ export HMCL_USER_HOME="$HOME/.local/share/hmcl"
271+ else
272+ export HMCL_USER_HOME="$XDG_DATA_HOME/hmcl"
273+ fi
270274 fi
271- if [ -z "${HMCL_LOCAL_HOME+x }" ]; then
275+ if [ -z "${HMCL_LOCAL_HOME:- }" ]; then
272276 export HMCL_LOCAL_HOME="$HMCL_USER_HOME/local-%s"
273277 fi
274- if [ -z "${HMCL_DEPENDENCIES_DIR+x }" ]; then
278+ if [ -z "${HMCL_DEPENDENCIES_DIR:- }" ]; then
275279 export HMCL_DEPENDENCIES_DIR="$HMCL_USER_HOME/dependencies"
276280 fi
277281 exec %s "$@"
You can’t perform that action at this time.
0 commit comments