Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion rgbenv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

# SPDX-License-Identifier: MIT
#
Expand All @@ -22,6 +22,29 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

if ! (command -v bash 2>&1 > /dev/null); then
echo "Sorry, rgbenv requires bash."
exit 1
fi

if [ "${SHELL}" != "$(command -v bash)" ]; then
# Prevent boundless recursion
if [ -z "${REEXEC_COUNT}" ]; then
RGBENV_REEXEC_COUNT=0
else
RGBENV_REEXEC_COUNT=$(expr ${RGBENV_REEXEC_COUNT} + 1)
fi
export RGBENV_REEXEC_COUNT

if [ "${RGBENV_REEXEC_COUNT}" -gt 1 ]; then
exit
fi

exec /usr/bin/env bash "${0}" "${@}"
fi

set -euo pipefail

# --------------- Constant defines -------------------------------------------------

RGBDS_GIT="https://github.com/gbdev/rgbds"
Expand Down