This repository was archived by the owner on Jul 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiOSHelper.command
More file actions
executable file
·85 lines (66 loc) · 2.63 KB
/
Copy pathiOSHelper.command
File metadata and controls
executable file
·85 lines (66 loc) · 2.63 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
### Init
cd -- "$(dirname "$0")"
OLDIFS=$IFS
IFS=$'\n'
shopt -s nullglob
### Variable declaration
## Control script flow
nextstep="true"
## File with new folder info
updfold="_UPDATE"
updfile="content_history.lpl"
## New folder info
foldShared="" # AA000AA0-AAA0-0000-AA00-000000000000
foldPrivat="" # BB111BB1-BBB1-1111-BB11-111111111111
## RetroArch Shader folder
foldRetroShad="./RetroArch/shaders_glsl"
### Rename Update file name to avoid modification
if [ ! -e "$updfold/$updfile" ]; then
echo "File di aggiornamento \"$updfile\" non trovato nella cartella \"$updfold\""
nextstep="false"
else
updfileorig=$updfile
updfile=${updfile%.*}.upd
mv "$updfold/$updfileorig" "$updfold/$updfile"
fi
### Load new folders name from RetroArch History file
if [ $nextstep == "true" ]; then
foldShared=$(sed -n '1h;1!H;${g;s:^.*\/var\/mobile\/Containers\/Data\/Application\/\([0-9A-Z]\{8\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{12\}\).*:\1:p;}' "$updfold/$updfile")
foldPrivat=$(sed -n '1h;1!H;${g;s:^.*\/var\/containers\/Bundle\/Application\/\([0-9A-Z]\{8\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{12\}\).*:\1:p;}' "$updfold/$updfile")
# echo $foldShared
# echo $foldPrivat
if [ -n $foldShared -a -n $foldPrivat ]; then
echo "Update folder extraction complete"
else
echo "Update folder extraction failed"
nextstep="false"
fi
fi
### Inject new folders name into target files
if [ $nextstep == "true" ]; then
## Update folder name into RetroArch Config, RetroArch Playlist and DOSBox confing file
for f in $(find . -name '*retroarch.cfg' -or -name '*.lpl' -or -name '*.conf'); do
echo "Updating file: $f"
mv "$f" "$f.sed"
sed s:"[0-9A-Z]\{8\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{12\}":$foldShared: "$f.sed" > "$f"
mv "$f" "$f.sed"
sed s:"\(^.*\/var\/containers\/Bundle\/Application\/\)\([0-9A-Z]\{8\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{12\}\)\(.*\)":"\1$foldPrivat\3": "$f.sed" > "$f"
rm "$f.sed"
done
## Update folder name into RetroArch Shader preset
for f in $(find "$foldRetroShad" -maxdepth 1 -name '*.glslp'); do
echo "Updating file: $f"
mv "$f" "$f.sed"
sed s:"[0-9A-Z]\{8\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{12\}":$foldShared: "$f.sed" > "$f"
mv "$f" "$f.sed"
sed s:"\(^.*\/var\/containers\/Bundle\/Application\/\)\([0-9A-Z]\{8\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{12\}\)\(.*\)":"\1$foldPrivat\3": "$f.sed" > "$f"
rm "$f.sed"
done
fi
### Retore original Update file name
if [ $nextstep == "true" ]; then
mv "$updfold/$updfile" "$updfold/$updfileorig"
fi
### Finish
IFS=$OLDIFS