-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·63 lines (58 loc) · 1.28 KB
/
run.sh
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
#!/bin/bash
# Load configuration
source run.sh.config
# sh boolean, be careful
unknown_op=1
move_to_directory() {
if ! cd "$1"; then
printf "Failed to move to $2 directory. Check that it exists.\n" >&2;
return 1;
fi
return 0;
}
do_operation() {
unknown_op=1
case "$1" in
"init")
cp "$hacknet_dir"/FNA.dll .;
;;
"workaround-exe")
cp "$hacknet_dir"/Hacknet.exe .;
;;
"patcher")
"$builder" ../DeBugFinderPatcher/DeBugFinderPatcher.csproj /p:Configuration="$configuration";
;;
"spit")
"$exe_prefix" ./DeBugFinderPatcher.exe -exeDir "$hacknet_dir" -spit -nolaunch;
;;
"build")
"$builder" ../DeBugFinder/DeBugFinder.csproj /p:Configuration="$configuration";
;;
"patch-init")
"$exe_prefix" ./DeBugFinderPatcher.exe -exeDir "$hacknet_dir";
;;
"patch")
"$exe_prefix" ./DeBugFinderPatcher.exe -exeDir "$hacknet_dir" -nolaunch;
;;
"copy")
cp -v DeBugFinder.dll "$hacknet_dir";
;;
*)
printf "Unknown operation: %s\n" "$1" >&2
unknown_op=0
return 0;
esac
}
ourdir="$(readlink -f "$(dirname "$0")")"
if ! move_to_directory "$ourdir/lib" "'lib'"; then
exit 2;
fi
while [[ "$#" -gt 0 ]]; do
if ! do_operation "$1"; then
if [[ unknown_op -ne 0 ]]; then
printf "Failure in '%s' operation.\n" "$1" >&2
fi
exit 1
fi
shift;
done