mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-02-07 00:26:09 +01:00
20 lines
963 B
Bash
Executable File
20 lines
963 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# SPDX-FileCopyrightText: 2024 Gnuxie <Gnuxie@protonmail.com>
|
|
# SPDX-FileCopyrightText: 2022 The Matrix.org Foundation C.I.C.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0 AND AFL-3.0
|
|
|
|
# This is used as the entrypoint in the draupnir Dockerfile.
|
|
# We want to transition away form people running the image without specifying `bot` or `appservice`.
|
|
# So if eventually cli arguments are provided for the bot version, we want this to be the opportunity to move to `bot`.
|
|
# Therefore using arguments without specifying `bot` (or appservice) is unsupported.
|
|
# We maintain the behaviour where if it looks like someone is providing an executable to `docker run`, then we will execute that instead.
|
|
# This aids configuration and debugging of the image if for example node needed to be started via another method.
|
|
case "$1" in
|
|
bot) shift; set -- node /draupnir/index.js "$@";;
|
|
appservice) shift; set -- node /draupnir/appservice/cli.js "$@";;
|
|
esac
|
|
|
|
exec "$@";
|