mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2025-12-24 07:08:19 -05:00
Make Bash completion work with POSIX mode (#978)
* Make Bask completion work with POSIX mode * Fix broken assignment
This commit is contained in:
@@ -32,10 +32,11 @@ __sdkman_complete_command() {
|
||||
done
|
||||
;;
|
||||
install|list)
|
||||
curl --silent "${SDKMAN_CANDIDATES_API}/candidates/all" | \
|
||||
local -r all_candidates=$(curl --silent "${SDKMAN_CANDIDATES_API}/candidates/all")
|
||||
|
||||
while IFS= read -d, -r candidate; do
|
||||
candidates+=($candidate)
|
||||
done
|
||||
done <<< "$all_candidates"
|
||||
;;
|
||||
env)
|
||||
candidates=("init install clear")
|
||||
@@ -72,10 +73,11 @@ __sdkman_complete_candidate_version() {
|
||||
done
|
||||
;;
|
||||
install)
|
||||
curl --silent "${SDKMAN_CANDIDATES_API}/candidates/$candidate/${SDKMAN_PLATFORM}/versions/all" | \
|
||||
local -r all_candidate_versions=$(curl --silent "${SDKMAN_CANDIDATES_API}/candidates/$candidate/${SDKMAN_PLATFORM}/versions/all")
|
||||
|
||||
while IFS= read -d, -r version; do
|
||||
candidates+=($version)
|
||||
done
|
||||
done <<< "$all_candidate_versions"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
2
src/test/groovy/sdkman/env/BashEnv.groovy
vendored
2
src/test/groovy/sdkman/env/BashEnv.groovy
vendored
@@ -46,7 +46,7 @@ class BashEnv {
|
||||
* Starts the external bash process.
|
||||
*/
|
||||
void start() {
|
||||
process = ["bash", "--noprofile", "--norc", "-i", "-o", "noclobber"].execute(env, workDir)
|
||||
process = ["bash", "--noprofile", "--norc", "--posix", "-i", "-o", "noclobber"].execute(env, workDir)
|
||||
|
||||
consumeProcessStream(process.inputStream)
|
||||
consumeProcessStream(process.errorStream)
|
||||
|
||||
Reference in New Issue
Block a user