Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Replace .envrc with a just recipe to install a default
✓ CI success Richard Levitte committed 16 days ago
commit a3481085f937f2739ea91bde9fb09a4ef5923379
parent 354805aeb3f871358426753198275738ff76a47e
1 passed (1 total) View logs
5 files changed +30 -5
deleted .envrc
@@ -1,3 +0,0 @@
-
watch_file rust-toolchain.toml
-

-
use flake
modified .gitignore
@@ -3,5 +3,5 @@
/build/artifacts
/build/*.tar.gz
/.pre-commit-config.yaml
-
/.direnv/
+
/.envrc
/result
modified justfile
@@ -136,6 +136,7 @@ verify-tool tool package_name="":
# in the patch and prompts for confirmation, preventing arbitrary code execution.
#
# Install git hooks
+
[group('dev')]
[group('hooks')]
install-hooks:
    @SUCCESS="{{SUCCESS}}" NORMAL="{{NORMAL}}" scripts/just/install-hooks.sh "{{hook-script}}" "{{hooks}}"
@@ -144,3 +145,9 @@ install-hooks:
[group('hooks')]
check-hooks:
    @HINT="{{HINT}}" NORMAL="{{NORMAL}}" WARN="{{WARN}}" scripts/just/check-hooks.sh "{{hook-script}}" "{{hooks}}"
+

+
# Install default .envrc (append to existing, if there is one)
+
[group('dev')]
+
[group('nix')]
+
install-envrc:
+
    @SUCCESS="{{SUCCESS}}" NORMAL="{{NORMAL}}" scripts/just/install-default-envrc.sh
modified scripts/git-hook-template.sh
@@ -9,7 +9,8 @@ then
    exit 1
fi

-
readonly SENSITIVE_FILES=("justfile" "build.rs" "rust-toolchain.toml")
+
readonly SENSITIVE_FILES=("justfile" "build.rs" "rust-toolchain.toml"
+
                          "scripts/just/install-default-envrc.sh")
readonly BASE_BRANCH="master"

# Check which files were modified compared to the base branch.
added scripts/just/install-default-envrc.sh
@@ -0,0 +1,20 @@
+
#! /usr/bin/env bash
+
set -e
+

+
message="${SUCCESS}.envrc installed${NORMAL}"
+
if [ -f .envrc ]; then
+
    message="${SUCCESS}.envrc updated${NORMAL}"
+
    sed -i~ -e '/^#:begin:default$/,/^#:end:default$/d' .envrc
+
fi
+
cat <<_____ >> .envrc
+
#:begin:default
+
if has nix
+
then
+
  watch_file rust-toolchain.toml
+
  use flake
+
fi
+
#:end:default
+
_____
+

+
echo ""
+
echo "${message}"