Skip to content

Instantly share code, notes, and snippets.

@bzm3r
Last active December 7, 2023 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bzm3r/fe9beeb3e9b82b555defed8a02a35bf3 to your computer and use it in GitHub Desktop.
Save bzm3r/fe9beeb3e9b82b555defed8a02a35bf3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -x
ENV_SNAPSHOT=$(realpath -- "$(dirname -- "${BASH_SOURCE[0]}")/recorded_env")
source "$ENV_SNAPSHOT"
# make a .cargo directory (if it doesn't already exist)
echo "Creating CARGO_HOME at /home/bzm3r/.cargo_rust-shell"
# TODO: Should do folder creation elegantly/robustly later (check to see
# if it exists, rather than just blindly creating it).
CARGO_HOME="$(realpath /home/bzm3r/.cargo_rust-shell)"
export CARGO_HOME
mkdir "$CARGO_HOME"
# overwrite any existing config.toml with one from home.
# TODO: in the future, perform a merge with an existing file?
cp --remove-destination /home/bzm3r/.cargo_rust-shell /home/bzm3r/.cargo_rust-shell/config.toml
# create .<name>_sccache cargoConfigDir (if it doesn't already exist)
echo "Creating SCCACHE_DIR at /home/bzm3r/.sccache_rust-shell"
SCCACHE_DIR="$(realpath /home/bzm3r/.sccache_rust-shell)"
mkdir "$SCCACHE_DIR"
export SCCACHE_DIR
# name of the workspace for purposes such as
export DEFAULT_WORKSPACE=rust-shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment