Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- usage(){
- echo "Usage: $0 "
- echo "This script needs to be run from the base install directory."
- echo "-h for this dialog."
- }
- rmathing(){
- x="$(realpath -s "$1")"
- filex="$(file "$x")"
- if ! [[ "$filex" == *" (No such file or directory)" ]]; then #it exist
- if [[ "$filex" == *": directory" ]]; then #it dir. use dir cmd instead.
- echo "Running: rm -r $x"
- rm -r "$x"
- else
- echo "Running: rm $x"
- rm "$x"
- fi
- fi
- }
- linkathing(){
- x="$(realpath -s "$1")"
- y="$(realpath -s "$2")"
- filex="$(file "$x")"
- if ! [[ "$filex" == *" (No such file or directory)" ]]; then #it exist
- if [[ "$filex" == *": symbolic link to "* ]]; then #it symlink. maybe from past.
- rmathing "$x" #past symlink could point wrong way. so update it anyways.
- fi
- echo "Running: ln -s $x $y"
- ln -s "$x" "$y"
- fi
- }
- if (( $# >= 0 )); then
- while getopts "h" OPTION; do
- case "${OPTION}" in
- h)
- usage
- exit
- ;;
- \?)
- exit
- ;;
- esac
- done
- shift "$(($OPTIND -1))"
- cd "$(realpath "$(dirname "$0")")"
- if ! [[ "$PWD" == *"Divinity Original Sin 2" ]]; then #we in wrong dir. abort.
- zenity --info --text="Error with $0:\n\nThere was a problem changing to or verifying the install directory.\nEnsure this script is in the Divinity Original Sin 2 directory.\nDiagnosing and fixing the problem is beyond the abilities of this script.\n\nExiting." --width=250
- echo "ERROR: Wrong dir. Aborting."
- exit
- fi
- rmathing ./bin
- linkathing ./DefEd/bin ./bin
- rmathing ./Data
- linkathing ./DefEd/Data ./Data
- rmathing ./bin/SupportTool.exe
- linkathing ./bin/EoCApp.exe ./bin/SupportTool.exe
- else
- usage
- fi
Advertisement
Add Comment
Please, Sign In to add comment