Skip to content

Commit 36b8df7

Browse files
committed
added .envrc-java
1 parent 2af7db0 commit 36b8df7

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

Diff for: .envrc-java

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
# vim:ts=4:sts=4:sw=4:et
3+
#
4+
# Author: Hari Sekhon
5+
# Date: 2025-03-20 01:55:20 +0800 (Thu, 20 Mar 2025)
6+
#
7+
# https://github.com/HariSekhon/DevOps-Bash-tools
8+
#
9+
# License: see accompanying Hari Sekhon LICENSE file
10+
#
11+
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
12+
#
13+
# https://www.linkedin.com/in/HariSekhon
14+
#
15+
16+
# ============================================================================ #
17+
# J a v a D i r E n v
18+
# ============================================================================ #
19+
20+
# .envrc to auto-load the virtualenv inside the 'venv' directory if present
21+
22+
# https://direnv.net/man/direnv-stdlib.1.html
23+
24+
set -euo pipefail
25+
[ -n "${DEBUG:-}" ] && set -x
26+
#srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
27+
28+
if [ -f .sdkmanrc ]; then
29+
if ! [ -f ~/.sdkman/etc/config ] ||
30+
! grep -q '^[[:space:]]*sdkman_auto_env[[:space:]]*=[[:space:]]*true' ~/.sdkman/etc/config; then
31+
if [ -f ~/.sdkman/bin/sdkman-init.sh ]; then
32+
# shellcheck disable=SC1090
33+
. ~/.sdkman/bin/sdkman-init.sh
34+
fi
35+
# it's not a binary but a function, so no type -P
36+
if type sdk &>/dev/null; then
37+
sdk env install
38+
fi
39+
fi
40+
fi
41+
42+
# read .env too
43+
#dotenv

0 commit comments

Comments
 (0)