Skip to content

Commit

Permalink
fix: boolean check for flags (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Ribeiro authored Jan 2, 2024
1 parent 8aa6a8d commit 8aef327
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
2 changes: 2 additions & 0 deletions src/scripts/change-malloc-implementation.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

sudo apt update

if [[ ${PARAM_IMPLEMENTATION} == "jemalloc" ]]; then
sudo apt install libjemalloc-dev
echo "LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" | sudo tee -a /etc/environment
Expand Down
72 changes: 36 additions & 36 deletions src/scripts/start-emulator.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
#!/bin/bash
if [ -n "${PARAM_OVERRIDE_ARGS}" ]; then
echo "override-args parameter was supplied; orb defaults will be overridden"
emulator -avd ${PARAM_AVD_NAME} ${PARAM_OVERRIDE_ARGS}
else
if [ "${PARAM_NO_WINDOW}" == "true" ]; then
set -- "$@" -no-window
fi
if [ "${PARAM_NO_AUDIO}" == "true" ]; then
set -- "$@" -no-audio
fi
if [ "${PARAM_NO_BOOT_ANIM}" == "true" ]; then
set -- "$@" -no-boot-anim
fi
if [ "${PARAM_VERBOSE}" == "true" ]; then
set -- "$@" -verbose
fi
if [ "${PARAM_NO_SNAPSHOT}" == "true" ]; then
set -- "$@" -no-snapshot
fi
if [ "${PARAM_DELAY_ABD}" == "true" ]; then
set -- "$@" -delay-adb
fi
if [ "${PARAM_MEMORY}" != "-1" ]; then
set -- "$@" -memory ${PARAM_MEMORY}
fi
if [ -n "${PARAM_GPU}" ]; then
set -- "$@" -gpu "${PARAM_GPU}"
fi
if [ -n "${PARAM_CAMERA_FRONT}" ]; then
set -- "$@" -camera-front "${PARAM_CAMERA_FRONT}"
fi
if [ -n "${PARAM_CAMERA_BACK}" ]; then
set -- "$@" -camera-back "${PARAM_CAMERA_BACK}"
fi
echo "Starting emulator with arguments $* ${PARAM_ADDITIONAL_ARGS}"
emulator -avd ${PARAM_AVD_NAME} "$@" ${PARAM_ADDITIONAL_ARGS}
fi
echo "override-args parameter was supplied; orb defaults will be overridden"
emulator -avd ${PARAM_AVD_NAME} ${PARAM_OVERRIDE_ARGS}
else
if [ "${PARAM_NO_WINDOW}" -eq 1 ]; then
set -- "$@" -no-window
fi
if [ "${PARAM_NO_AUDIO}" -eq 1 ]; then
set -- "$@" -no-audio
fi
if [ "${PARAM_NO_BOOT_ANIM}" -eq 1 ]; then
set -- "$@" -no-boot-anim
fi
if [ "${PARAM_VERBOSE}" -eq 1 ]; then
set -- "$@" -verbose
fi
if [ "${PARAM_NO_SNAPSHOT}" -eq 1 ]; then
set -- "$@" -no-snapshot
fi
if [ "${PARAM_DELAY_ABD}" -eq 1 ]; then
set -- "$@" -delay-adb
fi
if [ "${PARAM_MEMORY}" != "-1" ]; then
set -- "$@" -memory ${PARAM_MEMORY}
fi
if [ -n "${PARAM_GPU}" ]; then
set -- "$@" -gpu "${PARAM_GPU}"
fi
if [ -n "${PARAM_CAMERA_FRONT}" ]; then
set -- "$@" -camera-front "${PARAM_CAMERA_FRONT}"
fi
if [ -n "${PARAM_CAMERA_BACK}" ]; then
set -- "$@" -camera-back "${PARAM_CAMERA_BACK}"
fi
echo "Starting emulator with arguments $* ${PARAM_ADDITIONAL_ARGS}"
emulator -avd ${PARAM_AVD_NAME} "$@" ${PARAM_ADDITIONAL_ARGS}
fi

0 comments on commit 8aef327

Please sign in to comment.