Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
Replace .envrc with envrc.repo, allowing the devs to have their own .envrc
Merged levitte opened 8 days ago

It’s recommended that developers do this to use envrc.repo:

echo 'source_env envrc.repo' >> .envrc

This is a simpler alternative to rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/cob/xyz.radicle.patch/f599406e5917dd771c83af3de1a1691eed2206ed

There is a discussion topic on Radicle’s zulip chat related to this: https://radicle.zulipchat.com/#narrow/channel/369277-heartwood/topic/Do.20we.20.2Ahave.2A.20to.20have.20a.20versioned.20.60.2Eenvrc.60.3F/with/590136127

6 files changed +32 -4 bdd991a5 5d8988b1
deleted .envrc
@@ -1,3 +0,0 @@
-
watch_file rust-toolchain.toml
-

-
use flake
added .envrc.repo
@@ -0,0 +1,5 @@
+
# Developers that want to use this can add 'source_env envrc.repo' in their .envrc
+
if has nix; then
+
   watch_file rust-toolchain.toml
+
   use flake
+
fi
modified .gitignore
@@ -3,5 +3,6 @@
/build/artifacts
/build/*.tar.gz
/.pre-commit-config.yaml
+
/.envrc
/.direnv/
/result
modified justfile
@@ -137,6 +137,7 @@ verify-tool tool package_name="":
#
# Install git hooks
[group('hooks')]
+
[group('dev')]
install-hooks:
    @SUCCESS="{{SUCCESS}}" NORMAL="{{NORMAL}}" scripts/just/install-hooks.sh "{{hook-script}}" "{{hooks}}"

@@ -144,3 +145,8 @@ 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')]
+
install-envrc:
+
    @SUCCESS="{{SUCCESS}}" NORMAL="{{NORMAL}}" scripts/just/install-default.envrc.sh
modified scripts/git-hook-template.sh
@@ -9,7 +9,12 @@ then
    exit 1
fi

-
readonly SENSITIVE_FILES=("justfile" "build.rs" "rust-toolchain.toml")
+
SENSITIVE_FILES=("justfile" "build.rs" "rust-toolchain.toml")
+
if [ -f ".envrc" ]; then
+
    SENSITIVE_FILES+=(".envrc.repo")
+
fi
+
readonly SENSITIVE_FILES
+

readonly BASE_BRANCH="master"

# Check which files were modified compared to the base branch.
added scripts/just/install-default.envrc.sh
@@ -0,0 +1,14 @@
+
#! /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
+
source_env .envrc.repo
+
#:end:default
+
_____
+
echo ""
+
echo "${message}"