Skip to content

Commit 05bed97

Browse files
committed
Fix openleetcodeui.sh script for Darwin.
1 parent a4903cd commit 05bed97

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/ui/openleetcodeui.sh

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
#!/bin/bash
22

33
run_exe() {
4-
for D in OpenLeetCodeUI; do
5-
if [ -f "${D}/OpenLeetCodeUI" ]; then
6-
echo "Running OpenLeetCodeUI in ${D}"
7-
"${D}/OpenLeetCodeUI" --problem_builds_dir=$(pwd)
4+
if [[ "$(uname)" == "Darwin" ]]; then
5+
app_path="./OpenLeetCodeUI/OpenLeetCodeUI.app/Contents/MacOS/OpenLeetCodeUI"
6+
echo "app_path: $app_path"
7+
if [ -x "$app_path" ]; then
8+
echo "Running OpenLeetCodeUI"
9+
"$app_path" --problem_builds_dir="$(pwd)"
810
exit
11+
else
12+
echo "Error: OpenLeetCodeUI executable not found or not executable at $app_path"
913
fi
10-
done
11-
echo "No OpenLeetCodeUI found in $(pwd)/OpenLeetCodeUI directory."
14+
elif [[ "$(uname)" == "Linux" ]]; then
15+
for D in OpenLeetCodeUI; do
16+
if [ -f "${D}/OpenLeetCodeUI" ]; then
17+
echo "Running OpenLeetCodeUI in ${D}"
18+
"${D}/OpenLeetCodeUI.app" --problem_builds_dir=$(pwd)
19+
exit
20+
fi
21+
done
22+
echo "No OpenLeetCodeUI found in $(pwd)/OpenLeetCodeUI directory."
23+
else
24+
echo "Only Mac and Linux are supported."
25+
fi
1226
}
1327

1428
pushd "$(dirname "$0")" > /dev/null

0 commit comments

Comments
 (0)