File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -145,4 +145,6 @@ if [[ "$sdkman_auto_env" == "true" ]]; then
145145
146146 [[ -z " $PROMPT_COMMAND " ]] && PROMPT_COMMAND=" sdkman_auto_env" || PROMPT_COMMAND=" ${PROMPT_COMMAND% \; } ;sdkman_auto_env"
147147 fi
148- fi
148+
149+ sdkman_auto_env
150+ fi
Original file line number Diff line number Diff line change @@ -127,6 +127,33 @@ class EnvCommandSpec extends SdkmanEnvSpecification {
127127 ' false' | { ! it. contains(" Using groovy version 2.4.1 in this shell" ) }
128128 }
129129
130+ def " should execute 'sdk env' when opening a new terminal in a directory with an .sdkmanrc" () {
131+ given :
132+ new FileTreeBuilder (candidatesDirectory). with {
133+ " groovy" {
134+ " 2.4.1" {}
135+ }
136+ }
137+
138+ bash = sdkmanBashEnvBuilder
139+ .withVersionCache(" x.y.z" )
140+ .withOfflineMode(true )
141+ .withConfiguration(" sdkman_auto_env" , " true" )
142+ .build()
143+
144+ new FileTreeBuilder (bash. workDir). with {
145+ " .sdkmanrc" (" groovy=2.4.1\n " )
146+ }
147+
148+ bash. start()
149+
150+ when :
151+ bash. execute(" source $bootstrapScript " )
152+
153+ then :
154+ bash. output. contains(" Using groovy version 2.4.1 in this shell" )
155+ }
156+
130157 def " should issue an error if .sdkmanrc contains a malformed candidate version" () {
131158 given :
132159 bash = sdkmanBashEnvBuilder
You can’t perform that action at this time.
0 commit comments