-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPegasArch.sh
executable file
·85 lines (62 loc) · 1.34 KB
/
PegasArch.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
pegasarch="$(readlink -f "$0")"
pegasarch_path="$(dirname "$pegasarch")"
source "$pegasarch_path/src/pegasarch.bash"
menu="$1"
if [[ $menu == launch ]] ; then
shift
pegasarch_launch "$@"
exit $?
fi
if [[ $menu == scrap ]] ; then
shift
pegasarch_scrap "$@"
exit $?
fi
if [[ $menu == refresh ]] ; then
shift
install_libretro_cores || exit 1
pegasarch_cloud "$@"
pegasarch_scrap "$@"
exit $?
fi
if [[ $menu == pegasus ]] ; then
shift
flatpak run org.pegasus_frontend.Pegasus "$@" &
exit $?
fi
if [[ $menu == cloud ]] ; then
pegasarch_cloud "$@"
exit $?
fi
if [[ $menu == cloudsave ]] ; then
sync_save
exit $?
fi
if [[ $menu == install-cores ]] ; then
install_libretro_cores
exit $?
fi
if [[ $menu == help ]] ; then
cat $help.txt "$pegasarch_path/resources/help.txt"
exit 0
fi
if [[ $menu == config ]] ; then
rclone_config_if_none
edit_table
exit 0
fi
if [[ $menu ]] ; then
echo.red unknown option $menu
cat $help.txt "$pegasarch_path/resources/help.txt"
exit 1
fi
check_table || exit 42
if [[ -z $(ls "$pegasarch_path"/metadatas/*/metadata.pegasus.txt 2>/dev/null) ]] ; then
echo.blue "No metadatas yet, let's refresh"
install_libretro_cores || exit 1
pegasarch_cloud "$@" || exit 2
pegasarch_scrap "$@" || exit 3
fi
sync_save &
flatpak run org.pegasus_frontend.Pegasus &