blob: 21f9080f5f1bae3dd4d1cf50bb36eaa4bb347126 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
59,65c59
< if ! test -z "$MEGAMEK_CONFPATH"; then
< if ! test -d "/.$MEGAMEK_CONFPATH" -a \
< -f "/.$MEGAMEK_CONFPATH/$MEGAMEK_DEFAULT_JARNAME"; then
< echo "Relative path: $MEGAMEK_CONFPATH. Clearing."
< MEGAMEK_CONFPATH=""
< fi
< fi
---
> # MEGAMEK_CONFPATH may be set before hand, which is not desired.
67,78c61,66
< temp_path=$MEGAMEK_DEFAULT_CONFPATH
< if test -d $temp_path; then
< MEGAMEK_CONFPATH=$temp_path
< else
< # See if we should create the default configuration directory.
< if test -d $MEGAMEK_DEFAULT_CONFROOT -a \
< -w $MEGAMEK_DEFAULT_CONFROOT; then
< mkdir $temp_path
< if test -d $temp_path; then
< MEGAMEK_CONFPATH=$temp_path
< fi
< fi
---
> conf=$HOME/.config/mekhq
>
> if [[ -n "$XGD_CONFIG_HOME" ]]
> then
> conf="$XDG_CONFIG_HOME/mekhq"
> fi
80,85c68,70
< # If MEGAMEK_CONFPATH is still not set, try the PWD.
< if test -z "$MEGAMEK_CONFPATH"; then
< if test -w $PWD; then
< MEGAMEK_CONFPATH=$PWD
< fi
< fi
---
> if [[ ! -d "$conf" ]]
> then
> mkdir -p "$conf"
86a72,73
>
> MEGAMEK_CONFPATH="$conf"
90c77
< if test -z "$MEGAMEK_CONFPATH"; then
---
> if ! test -d "$MEGAMEK_CONFPATH"; then
|