-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyour_program.sh
More file actions
executable file
·33 lines (29 loc) · 1.04 KB
/
your_program.sh
File metadata and controls
executable file
·33 lines (29 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
# Use this script to run your program LOCALLY.
#
# Note: Changing this script WILL NOT affect how CodeCrafters runs your program.
#
# Learn more: https://codecrafters.io/program-interface
set -e # Exit early if any commands fail
BUILD_MODE="release";
if [ "$1" = "dbg" ]; then
BUILD_MODE="debug";
fi
# Copied from .codecrafters/compile.sh
#
# - Edit this to change how your program compiles locally
# - Edit .codecrafters/compile.sh to change how your program compiles remotely
(
cd "$(dirname "$0")" # Ensure compile steps are run within the repository directory
if [ "$BUILD_MODE" = "debug" ]; then
cargo build --target-dir=/tmp/codecrafters-build-shell-rust --manifest-path Cargo.toml
else
cargo build --release --target-dir=/tmp/codecrafters-build-shell-rust --manifest-path Cargo.toml
fi
)
# Copied from .codecrafters/run.sh
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec /tmp/codecrafters-build-shell-rust/"$BUILD_MODE"/codecrafters-shell "$@"