Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Nov 23, 2023
1 parent 8a6509d commit 046ac19
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions lila-docker
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,8 @@ if [ ! -z "$GITPOD_WORKSPACE_ID" ]; then
export PICFIT_DOMAIN=$(gp url 3001 | cut -c9-)
fi

rust_cmd() {
if [ ! -z "$(which rustup)" ]; then
# if the host has Rust installed, use it directly
cargo build --release --manifest-path command/Cargo.toml
./command/target/release/command "$@"
elif [ "$(uname)" = "Darwin" ]; then
docker run --rm -v "$PWD/command:/command" -w /command messense/cargo-zigbuild:0.18.0 \
cargo zigbuild --release --target universal2-apple-darwin
./command/target/universal2-apple-darwin/release/command "$@"
else
docker run --rm -v "$PWD/command:/command" -w /command messense/cargo-zigbuild:0.18.0 \
cargo zigbuild --release
./command/target/release/command "$@"
fi
}

run_setup() {
rust_cmd setup

export $(cat .env | xargs)

docker compose build
Expand Down Expand Up @@ -96,6 +79,22 @@ run_formatter() {
docker compose exec lila sbt scalafmtAll || docker compose run --rm --entrypoint "sbt scalafmtAll" lila
}

rust_cmd() {
if [ ! -z "$(which rustup)" ]; then
# if the host has Rust installed, use it directly
cargo build --release --manifest-path command/Cargo.toml
./command/target/release/command "$@"
elif [ "$(uname)" = "Darwin" ]; then
docker run --rm -v "$PWD/command:/command" -w /command messense/cargo-zigbuild:0.18.0 \
cargo zigbuild --release --target universal2-apple-darwin
./command/target/universal2-apple-darwin/release/command "$@"
else
docker run --rm -v "$PWD/command:/command" -w /command messense/cargo-zigbuild:0.18.0 \
cargo zigbuild --release
./command/target/release/command "$@"
fi
}

show_help() {
echo "Usage: $0 [start|stop|restart|down|build|format]"
}
Expand Down

0 comments on commit 046ac19

Please sign in to comment.