-
-
Notifications
You must be signed in to change notification settings - Fork 86
/
macos_init_amiberry.zsh
124 lines (108 loc) · 5.71 KB
/
macos_init_amiberry.zsh
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env zsh
CWD_VAR=$(cd "$(dirname "$0")"; pwd)
USERDIR=`echo ~`
if [[ ! -f "$USERDIR/Library/Application Support/Amiberry/amiberry.conf" ]]; then
cat $CWD_VAR/../Resources/Configurations/amiberry-osx.conf | sed -e "s#USERDIR#$USERDIR#g" > "$USERDIR/Library/Application Support/Amiberry/amiberry.conf"
fi
for file in $CWD_VAR/../Resources/Configurations/**/*(.); do
if [[ "$file" != "$CWD_VAR/../Resources/Configurations/amiberry-osx.conf" ]]; then
if [[ "$file" != "$CWD_VAR/../Resources/Configurations/amiberry.conf" ]]; then
if [[ ! -f "$USERDIR/Library/Application Support/Amiberry${file##*/Configurations}" ]]; then
echo "Copying $file to $USERDIR/Library/Application Support/Amiberry${file##*/Configurations}"
mkdir -p $(dirname "$USERDIR/Library/Application Support/Amiberry${file##*/Configurations}")
cp $file "$USERDIR/Library/Application Support/Amiberry${file##*/Configurations}"
fi
fi
fi
done
for file in $CWD_VAR/../Resources/Cdroms/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Cdroms${file##*/Cdroms}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Cdroms${file##*/Cdroms}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Cdroms${file##*/Cdroms}")
cp $file "$USERDIR/Documents/Amiberry/Cdroms${file##*/Cdroms}"
fi
done
for file in $CWD_VAR/../Resources/Controllers/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Controllers${file##*/Controllers}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Controllers${file##*/Controllers}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Controllers${file##*/Controllers}")
cp $file "$USERDIR/Documents/Amiberry/Controllers${file##*/Controllers}"
fi
done
for file in $CWD_VAR/../Resources/Kickstarts/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Kickstarts${file##*/Kickstarts}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Kickstarts${file##*/Kickstarts}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Kickstarts${file##*/Kickstarts}")
cp $file "$USERDIR/Documents/Amiberry/Kickstarts${file##*/Kickstarts}"
fi
done
for file in $CWD_VAR/../Resources/Data/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Data${file##*/Data}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Data${file##*/Data}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Data${file##*/Data}")
cp $file "$USERDIR/Documents/Amiberry/Data${file##*/Data}"
fi
done
for file in $CWD_VAR/../Resources/Floppies/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Floppies${file##*/Floppies}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Floppies${file##*/Floppies}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Floppies${file##*/Floppies}")
cp $file "$USERDIR/Documents/Amiberry/Floppies${file##*/Floppies}"
fi
done
for file in $CWD_VAR/../Resources/Harddrives/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Harddrives${file##*/Harddrives}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Harddrives${file##*/Harddrives}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Harddrives${file##*/Harddrives}")
cp $file "$USERDIR/Documents/Amiberry/Harddrives${file##*/Harddrives}"
fi
done
for file in $CWD_VAR/../Resources/Savestates/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Savestates${file##*/Savestates}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Savestates${file##*/Savestates}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Savestates${file##*/Savestates}")
cp $file "$USERDIR/Documents/Amiberry/Savestates${file##*/Savestates}"
fi
done
for file in $CWD_VAR/../Resources/Inputrecordings/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Inputrecordings${file##*/Inputrecordings}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Inputrecordings${file##*/Inputrecordings}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Inputrecordings${file##*/Inputrecordings}")
cp $file "$USERDIR/Documents/Amiberry/Inputrecordings${file##*/Inputrecordings}"
fi
done
for file in $CWD_VAR/../Resources/Screenshots/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Screenshots${file##*/Screenshots}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Screenshots${file##*/Screenshots}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Screenshots${file##*/Screenshots}")
cp $file "$USERDIR/Documents/Amiberry/Screenshots${file##*/Screenshots}"
fi
done
for file in $CWD_VAR/../Resources/Lha/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Lha${file##*/Lha}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Lha${file##*/Lha}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Lha${file##*/Lha}")
cp $file "$USERDIR/Documents/Amiberry/Lha${file##*/Lha}"
fi
done
for file in $CWD_VAR/../Resources/Nvram/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Nvram${file##*/Nvram}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Nvram${file##*/Nvram}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Nvram${file##*/Nvram}")
cp $file "$USERDIR/Documents/Amiberry/Nvram${file##*/Nvram}"
fi
done
for file in $CWD_VAR/../Resources/Plugins/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Plugins${file##*/Plugins}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Plugins${file##*/Plugins}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Plugins${file##*/Plugins}")
cp $file "$USERDIR/Documents/Amiberry/Plugins${file##*/Plugins}"
fi
done
for file in $CWD_VAR/../Resources/Whdboot/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Whdboot${file##*/Whdboot}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Whdboot${file##*/Whdboot}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Whdboot${file##*/Whdboot}")
cp $file "$USERDIR/Documents/Amiberry/Whdboot${file##*/Whdboot}"
fi
done