Skip to content

Commit b8f44ef

Browse files
/scripts/run_desktop.sh: simplify and fix
1 parent 3cd66da commit b8f44ef

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scripts/run_desktop.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ binary=$(readlink -f "$binary")
5656
chmod +x "$binary"
5757

5858
pushd internal_filesystem/
59-
if [ -f "$script" ]; then
60-
"$binary" -v -i "$script"
61-
elif [ ! -z "$script" ]; then # it's an app name
62-
scriptdir="$script"
63-
echo "Running app from $scriptdir"
64-
"$binary" -X heapsize=$HEAPSIZE -v -i -c "$(cat main.py) ; import mpos.apps; mpos.apps.start_app('$scriptdir')"
65-
else
66-
"$binary" -X heapsize=$HEAPSIZE -v -i -c "$(cat main.py)"
67-
fi
68-
59+
60+
if [ -f "$script" ]; then
61+
echo "Running script $script"
62+
"$binary" -v -i "$script"
63+
else
64+
echo "Running app $script"
65+
# When $script is empty, it just doesn't find the app and stays at the launcher
66+
echo '{"auto_start_app": "'$script'"}' > data/com.micropythonos.settings/config.json
67+
"$binary" -X heapsize=$HEAPSIZE -v -i -c "$(cat main.py)"
68+
fi
6969

7070
popd

0 commit comments

Comments
 (0)