mirror of
https://github.com/aclist/dztui.git
synced 2025-01-01 15:12:05 +01:00
chore: debugging symlinks
This commit is contained in:
parent
aa358cbe12
commit
5364303dd1
1 changed files with 13 additions and 20 deletions
33
dzgui.sh
33
dzgui.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
version=3.4.0-rc.5
|
version=3.4.0-rc.6
|
||||||
|
|
||||||
aid=221100
|
aid=221100
|
||||||
game="dayz"
|
game="dayz"
|
||||||
|
@ -434,6 +434,7 @@ manual_mod_install(){
|
||||||
compare
|
compare
|
||||||
if [[ -z $diff ]]; then
|
if [[ -z $diff ]]; then
|
||||||
passed_mod_check > >($steamsafe_zenity --pulsate --progress --auto-close --width=500 2>/dev/null)
|
passed_mod_check > >($steamsafe_zenity --pulsate --progress --auto-close --width=500 2>/dev/null)
|
||||||
|
echo "${FUNCNAME[0]}" >> $config_path/dzdebug
|
||||||
launch
|
launch
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
@ -449,54 +450,45 @@ stale_symlinks(){
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
legacy_symlinks(){
|
legacy_symlinks(){
|
||||||
echo "ENTERED ${FUNCNAME[0]}" >> $config_path/dzdebug
|
|
||||||
for d in "$game_dir"/*; do
|
for d in "$game_dir"/*; do
|
||||||
if [[ $d =~ @[0-9]+-.+ ]]; then
|
if [[ $d =~ @[0-9]+-.+ ]]; then
|
||||||
unlink "$d"
|
unlink "$d"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "UNLINKED SYMS" >> $config_path/dzdebug
|
|
||||||
for d in "$workshop_dir"/*; do
|
for d in "$workshop_dir"/*; do
|
||||||
echo "dir is $d" >> $config_path/dzdebug
|
|
||||||
local id=$(awk -F"= " '/publishedid/ {print $2}' "$d"/meta.cpp | awk -F\; '{print $1}')
|
local id=$(awk -F"= " '/publishedid/ {print $2}' "$d"/meta.cpp | awk -F\; '{print $1}')
|
||||||
echo "id is $id" >> $config_path/dzdebug
|
|
||||||
local encoded_id=$(echo "$id" | awk '{printf("%c",$1)}' | base64 | sed 's/\//_/g; s/=//g; s/+/]/g')
|
local encoded_id=$(echo "$id" | awk '{printf("%c",$1)}' | base64 | sed 's/\//_/g; s/=//g; s/+/]/g')
|
||||||
echo "encoded id is $encoded_id" >> $config_path/dzdebug
|
|
||||||
if [[ -h "$game_dir/@$encoded_id" ]]; then
|
if [[ -h "$game_dir/@$encoded_id" ]]; then
|
||||||
echo "found sym, unlinking" >> $config_path/dzdebug
|
|
||||||
unlink "$game_dir/@$encoded_id"
|
unlink "$game_dir/@$encoded_id"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "FINISHED LEGACY UNLINKING" >> $config_path/dzdebug
|
|
||||||
}
|
}
|
||||||
symlinks(){
|
symlinks(){
|
||||||
echo "ENTERED ${FUNCNAME[0]}" >> $config_path/dzdebug
|
[[ -f $config_path/dzdebug ]] && rm $config_path/dzdebug
|
||||||
for d in "$workshop_dir"/*; do
|
readarray -t wdirs < <(find "$workshop_dir"/*/meta.cpp)
|
||||||
echo "dir is $d" >> $config_path/dzdebug
|
echo "found ${#wdirs[@]} mods" >> $config_path/dzdebug
|
||||||
id=$(awk -F"= " '/publishedid/ {print $2}' "$d"/meta.cpp | awk -F\; '{print $1}')
|
for (( i = 0; i < ${#wdirs[@]}; i++ )); do
|
||||||
echo "id is $id" >> $config_path/dzdebug
|
id=$(awk -F"= " '/publishedid/ {print $2}' "${wdirs[$i]}" | awk -F\; '{print $1}')
|
||||||
|
mod=$(awk -F\" '/name/ {print $2}' "${wdirs[$i]}" | sed -E 's/[^[:alpha:]0-9]+/_/g; s/^_|_$//g')
|
||||||
encoded_id=$(encode "$id")
|
encoded_id=$(encode "$id")
|
||||||
echo "encoded id is $encoded_id" >> $config_path/dzdebug
|
|
||||||
mod=$(awk -F\" '/name/ {print $2}' "$d"/meta.cpp | sed -E 's/[^[:alpha:]0-9]+/_/g; s/^_|_$//g')
|
|
||||||
echo "mod is $mod" >> $config_path/dzdebug
|
|
||||||
link="@$encoded_id"
|
link="@$encoded_id"
|
||||||
echo "link is $link" >> $config_path/dzdebug
|
echo "link: $link" >> $config_path/dzdebug
|
||||||
if [[ -h "$game_dir/$link" ]]; then
|
if [[ -h "$game_dir/$link" ]]; then
|
||||||
echo "link exists" >> $config_path/dzdebug
|
echo "link exists" >> $config_path/dzdebug
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
ln -fs "$d" "$game_dir/$link"
|
ln -fs "${wdirs[$i]}" "$game_dir/$link"
|
||||||
echo "making link" >> $config_path/dzdebug
|
echo "making link" >> $config_path/dzdebug
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
echo "finished symlinks" >> $config_path/dzdebug
|
||||||
}
|
}
|
||||||
passed_mod_check(){
|
passed_mod_check(){
|
||||||
echo "[DZGUI] Passed mod check"
|
echo "[DZGUI] Passed mod check"
|
||||||
echo "# Preparing symlinks"
|
echo "# Preparing symlinks"
|
||||||
legacy_symlinks
|
#legacy_symlinks
|
||||||
symlinks
|
symlinks
|
||||||
echo "100"
|
echo "100"
|
||||||
|
|
||||||
}
|
}
|
||||||
auto_mod_install(){
|
auto_mod_install(){
|
||||||
[[ -z $(is_steam_running) ]] && { $steamsafe_zenity --info --text "Steam must be running to use this feature."; return; }
|
[[ -z $(is_steam_running) ]] && { $steamsafe_zenity --info --text "Steam must be running to use this feature."; return; }
|
||||||
|
@ -631,6 +623,7 @@ connect(){
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
passed_mod_check > >($steamsafe_zenity --pulsate --progress --auto-close --width=500 2>/dev/null)
|
passed_mod_check > >($steamsafe_zenity --pulsate --progress --auto-close --width=500 2>/dev/null)
|
||||||
|
echo "${FUNCNAME[0]}" >> $config_path/dzdebug
|
||||||
update_history
|
update_history
|
||||||
launch
|
launch
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue