Skip to content

Commit 91e8f08

Browse files
committed
General: Adding support for repository branch..
1 parent f330bdc commit 91e8f08

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

setup.sh

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,33 @@ get_distribution() {
2222
# Get the distribution
2323
DISTRO=$(get_distribution)
2424

25+
# Default Branch
26+
BRANCH="stable"
27+
28+
# Parse arguments for --branch
29+
while [ "$#" -gt 0 ]; do
30+
case "$1" in
31+
--branch)
32+
if [ -n "$2" ]; then
33+
BRANCH="$2"
34+
shift 2
35+
continue
36+
else
37+
echo "Error: --branch requires a value (e.g. --branch dev)" >&2
38+
exit 1
39+
fi
40+
;;
41+
--branch=*)
42+
BRANCH="${1#*=}"
43+
shift
44+
continue
45+
;;
46+
*)
47+
shift
48+
;;
49+
case
50+
done
51+
2552
# Function to print the current step
2653
log_step() {
2754
echo "Step $1: $2"
@@ -86,9 +113,10 @@ if [ -d "/usr/share/thinOS" ] && [ ! -f "/usr/share/thinOS/.gitmodules" ]; then
86113
sudo rm -rf /usr/share/thinOS
87114
fi
88115
if [ -d "/usr/share/thinOS/.git" ]; then
116+
sudo git -C /usr/share/thinOS checkout $BRANCH
89117
sudo git -C /usr/share/thinOS pull --recurse-submodules
90118
else
91-
sudo git clone --recursive --branch dev https://github.com/LaswitchTech/thinOS.git /usr/share/thinOS
119+
sudo git clone --recursive --branch $BRANCH https://github.com/LaswitchTech/thinOS.git /usr/share/thinOS
92120
fi
93121

94122
# Configure uDevil to allow non-sudo mounting of USB drives
@@ -112,9 +140,10 @@ if [ -d "/usr/share/PyRDPConnect" ] && [ ! -f "/usr/share/PyRDPConnect/.gitmodul
112140
sudo rm -rf /usr/share/PyRDPConnect
113141
fi
114142
if [ -d "/usr/share/PyRDPConnect/.git" ]; then
143+
sudo git -C /usr/share/PyRDPConnect checkout $BRANCH
115144
sudo git -C /usr/share/PyRDPConnect pull --recurse-submodules
116145
else
117-
sudo git clone --recursive --branch dev https://github.com/LaswitchTech/PyRDPConnect.git /usr/share/PyRDPConnect
146+
sudo git clone --recursive --branch $BRANCH https://github.com/LaswitchTech/PyRDPConnect.git /usr/share/PyRDPConnect
118147
fi
119148

120149
# Create a gradient background image

0 commit comments

Comments
 (0)