don't repeat ~/

This commit is contained in:
Gwenhael Le Moine 2024-08-11 13:51:35 +02:00
parent f1b08f7b40
commit 24f5200322
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -1,21 +1,20 @@
#!/usr/bin/env sh
DOTX48NG=${DOTX48NG:-.config/x48ng}
CONFIG_FILE=~/"${DOTX48NG}"/config.lua
DOTX48NG=${DOTX48NG:-~/.config/x48ng}
CONFIG_FILE="${DOTX48NG}"/config.lua
ROM=${ROM:-./ROMs/gxrom-r}
# [ -d ~/"${DOTX48NG}" ] && rm -fr ~"/${DOTX48NG}"
mkdir -p ~/"${DOTX48NG}"
mkdir -p "${DOTX48NG}"
[ -e "${CONFIG_FILE}" ] && mv "${CONFIG_FILE}" "${CONFIG_FILE}".orig
x48ng --print-config > "${CONFIG_FILE}"
cp -r @PREFIX@/share/x48ng/ROMs/ ~/"${DOTX48NG}"/
cp -r @PREFIX@/share/x48ng/ROMs/ "${DOTX48NG}"/
cd ~/"${DOTX48NG}"/ROMs/ || exit 1
cd "${DOTX48NG}"/ROMs/ || exit 1
make get-roms
cd ~/"${DOTX48NG}" || exit 1
cd "${DOTX48NG}" || exit 1
[ -e rom ] && mv rom rom.orig
ln -s "$ROM" rom