|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 | 3 | 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)" |
8 | 10 | exit
|
| 11 | + else |
| 12 | + echo "Error: OpenLeetCodeUI executable not found or not executable at $app_path" |
9 | 13 | 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 |
12 | 26 | }
|
13 | 27 |
|
14 | 28 | pushd "$(dirname "0ドル")" > /dev/null
|
|
0 commit comments