This is an automated email from the ASF dual-hosted git repository.
msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless.git
The following commit(s) were added to refs/heads/main by this push:
new 6a1b357 direnv init (#15)
6a1b357 is described below
commit 6a1b357596349bae19d99a0532f36a13e4f512a7
Author: Mirella Di Girolamo <[email protected]>
AuthorDate: Thu Jul 11 17:11:03 2024 +0200
direnv init (#15)
Co-authored-by: Michele Sciabarra <[email protected]>
---
cloud-init.yaml | 7 ++-----
direnv-init.sh | 5 +++++
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/cloud-init.yaml b/cloud-init.yaml
index c5899a2..54d46dd 100644
--- a/cloud-init.yaml
+++ b/cloud-init.yaml
@@ -34,7 +34,7 @@ runcmd:
# use direnv for autoinit
echo 'eval "$(direnv hook bash)"' >>$HOME/.bashrc
# install nix
- curl -L https://nixos.org/nix/install | sudo -u "$USR" sh -s --
--no-daemon
+ curl -L https://nixos.org/nix/install | sudo -u "$USR" sh
# get openserverless sources
cd $HOME
# add aliases
@@ -45,10 +45,7 @@ runcmd:
sudo -u $USR git clone https://github.com/apache/openserverless
--recurse-submodules
cd $HOME/openserverless
sudo -u $USR bash sync-branch.sh
- sudo -u $USR direnv allow $HOME/openserverless/site
- sudo -u $USR direnv allow $HOME/openserverless/cli
- sudo -u $USR direnv allow $HOME/openserverless/operator
+ sudo -i -H -u $USR bash "$HOME/openserverless/direnv-init.sh"
# install license-eye and a git-hook
sudo -u $USR git config core.hooksPath .git-hooks
-
diff --git a/direnv-init.sh b/direnv-init.sh
new file mode 100755
index 0000000..84ba2f4
--- /dev/null
+++ b/direnv-init.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+cd "$(dirname "${BASH_SOURCE[0]}")" && pwd
+find . -name '.envrc' -execdir direnv allow . pwd \;
+find . -name '.envrc' -execdir direnv exec . pwd \;
+