diff options
author | Frederik Enste | 2020-04-19 13:44:12 +0200 |
---|---|---|
committer | Frederik Enste | 2020-04-19 13:44:12 +0200 |
commit | 1fdabdedbcf43fdab8c01cc602b6b2a7ab0d86b5 (patch) | |
tree | dfffb63094569bc8f6a0ed9e682ec66a6cf4771a /materialize-bin.sh | |
parent | d96648770da98ff3c59a6469d7ab8abc9bf73526 (diff) | |
download | aur-1fdabdedbcf43fdab8c01cc602b6b2a7ab0d86b5.tar.gz |
fixed texture import errors
Diffstat (limited to 'materialize-bin.sh')
-rwxr-xr-x | materialize-bin.sh | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/materialize-bin.sh b/materialize-bin.sh index 3a376d3f3b6e..92de5419f462 100755 --- a/materialize-bin.sh +++ b/materialize-bin.sh @@ -1,20 +1,47 @@ #! /bin/bash -set -e + +pkgname="materialize-bin" +pkgexec="Materialize.exe" +pkgdir="/opt/${pkgname}" +pkguser="${HOME}/.${pkgname}" arg=$1 if [[ "${arg}" == "--init" ]]; then + + echo "Initializing local symlink directory..." + mkdir --parents --verbose "${pkguser}" + find -L "${pkguser}" -type l -delete + cp --update --recursive --symbolic-link --verbose "${pkgdir}/"* "${pkguser}/" + echo "Initializing wineprefixe for materialize..." - echo 'If the initialization failes run "winetricks prefix=materialize-bin annihilate" and rerun "materialize-bin --init"' - echo ' ' - echo ' ' - winetricks -q prefix=materialize-bin arch=64 vcrun2019 corefonts + winetricks -q prefix=${pkgname} arch=64 win10 dxvk160 vcrun2019 corefonts + if [[ $? -ne 0 ]]; then + echo 'The initialization failed. Try running "materialize-bin --annihilate" and rerun "materialize-bin --init".' + exit 1 + fi + exit 0 -elif [[ -z "${arg}" ]]; then - cd "/opt/materialize-bin" - WINEPREFIX="$HOME/.local/share/wineprefixes/materialize-bin" wine Materialize.exe + +elif [[ "${arg}" == "--annihilate" ]]; then + + winetricks -q prefix=${pkgname} annihilate exit $? + +elif [[ -z "${arg}" ]]; then + + WINEPREFIX="$HOME/.local/share/wineprefixes/materialize-bin" wine "${pkguser}/${pkgexec}" + code=$? + if [[ ${code} -ne 0 ]]; then + echo 'The program returned an exit code not equal to 0. Did you already run "materialize-bin --init"?' + fi + exit ${code} + fi -echo "Unexpected argument." -echo "Use --init to initialize the wineprefix or none to start the program."
\ No newline at end of file +echo "Unexpected argument: ${arg}" +echo " " +echo "Options: " +echo " Without options the main program is launched." +echo " --init Initializes the wineprefix for this program." +echo " --annihilate Annihilates the wineprefix for this program." |