From 7009ebc9412d45bd2a75b36b08af4d92e8c71943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:03:52 +0200 Subject: [PATCH 1/3] chore: chmod +x --- init-env.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 init-env.sh diff --git a/init-env.sh b/init-env.sh old mode 100644 new mode 100755 From c5e1f46eba0beea6f569db25b0e7ef70322938e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:03:58 +0200 Subject: [PATCH 2/3] refactor: use brackets --- init-env.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init-env.sh b/init-env.sh index c4502e4..9505e89 100755 --- 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 From d77f7510cf0e3f59b814f68c92c2177f3ea08788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:04:22 +0200 Subject: [PATCH 3/3] docs: update init script name --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.