diff --git a/README.md b/README.md index 4b3f477..61b7dbc 100644 --- a/README.md +++ b/README.md @@ -62,13 +62,13 @@ It supports initialising all environments or specific ones based on the provided ### Usage ```sh -./init.sh [--what/-w all|r|python|julia] [--force/-f] [--help/-h] +./init-env.sh [--what/-w all|r|python|julia] [--force/-f] [--help/-h] ``` ### Script Details - **Options**: - - `--what/-w`: Specify which environment(s) to initialise (`all`, `r`, `python (uv)`, `julia`). + - `--what/-w`: Specify which environment(s) to initialise (`all`, `r`, `python` (uv), `julia`). - `--force/-f`: Force reinstallation of the specified environment(s). - `--help/-h`: Display help message and exit. - **Functionality**: The script installs necessary dependencies for R, Python, and Julia, inside environments. diff --git a/init-env.sh b/init-env.sh old mode 100644 new mode 100755 index c4502e4..9505e89 --- a/init-env.sh +++ b/init-env.sh @@ -12,7 +12,7 @@ show_help() { } initialise_r() { - if [ "$FORCE" = true ] || [ ! -f "renv.lock" ]; then + if [ "${FORCE}" = true ] || [ ! -f "renv.lock" ]; then if grep -q 'source("renv/activate.R")' .Rprofile; then sed -i '' '/source("renv\/activate.R")/d' .Rprofile fi @@ -23,7 +23,7 @@ initialise_r() { } initialise_python() { - if [ "$FORCE" = true ] || [ ! -f "requirements.txt" ]; then + if [ "${FORCE}" = true ] || [ ! -f "requirements.txt" ]; then python3 -m venv .venv source .venv/bin/activate python3 -m pip install jupyter papermill @@ -32,7 +32,7 @@ initialise_python() { } initialise_uv() { - if [ "$FORCE" = true ] || [ ! -f "uv.lock" ]; then + if [ "${FORCE}" = true ] || [ ! -f "uv.lock" ]; then uv init --no-package --vcs none --bare --no-readme --author-from none uv venv source .venv/bin/activate @@ -42,7 +42,7 @@ initialise_uv() { } initialise_julia() { - if [ "$FORCE" = true ] || [ ! -f "Project.toml" ]; then + if [ "${FORCE}" = true ] || [ ! -f "Project.toml" ]; then julia -e 'using Pkg; Pkg.activate("."); Pkg.instantiate()' julia --project=. -e 'using Pkg; Pkg.add("IJulia")' fi