diff --git a/OpenCast.sh b/OpenCast.sh index 237470d0..379ae31c 100755 --- a/OpenCast.sh +++ b/OpenCast.sh @@ -3,6 +3,7 @@ # ./OpenCast.sh command [...] # # Commands: +# deps Interact with dependencies. # format Run formatters on the source code. # generate Generate content. # lint Lint the source code. diff --git a/setup.sh b/setup.sh index 25a2d31e..d93923b2 100755 --- a/setup.sh +++ b/setup.sh @@ -42,8 +42,7 @@ install_project_deps() { log_info "Installing project dependencies..." curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python3 - "$ROOT/$INTERNAL_NAME.sh" service back update - (cd "$ROOT/webapp" && npm install) + "$ROOT/$INTERNAL_NAME.sh" deps install } # Format and install the systemd config file. diff --git a/tool/deps.sh b/tool/deps.sh new file mode 100755 index 00000000..60147e68 --- /dev/null +++ b/tool/deps.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Usage: +# ./deps.sh command +# +# Commands: +# install Install all dependencies. +# update Update python dependencies. + +HERE="$(cd "$(dirname "${BASH_SOURCE:-0}")" && pwd)" +ROOT="$(cd "$HERE/.." && pwd)" + +# shellcheck source=script/cli_builder.sh +source "$ROOT/script/cli_builder.sh" +# shellcheck source=script/env.sh +source "$ROOT/script/env.sh" + +install() { + (cd "$ROOT" && poetry install) + (cd "$ROOT/webapp" && npm install) +} + +update() { + (cd "$ROOT" && poetry update) +} + +parse_args "$@" +${ARGS["command"]} diff --git a/tool/service-back.sh b/tool/service-back.sh index 7b9daec4..e4124e76 100755 --- a/tool/service-back.sh +++ b/tool/service-back.sh @@ -8,7 +8,6 @@ # stop Stop the service. # restart Restart the service. # status Display the status of the service. -# update Update the dependencies of the service. HERE="$(cd "$(dirname "${BASH_SOURCE:-0}")" && pwd)" ROOT="$(cd "$HERE/.." && pwd)" @@ -54,11 +53,5 @@ status() { log_status "$SERVICE_NAME" "$status" } -update() { - log_info "Checking for updates." - - poetry update -} - parse_args "$@" ${ARGS["command"]}