File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed
website/content/v1.12/reference Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ Note for zsh users: [1] zsh completions are only supported in versions of zsh >=
3838## Load the talosctl completion code for bash into the current shell
3939 source <(talosctl completion bash)
4040## Write bash completion code to a file and source if from .bash_profile
41- talosctl completion bash > ~ /.talos/completion.bash.inc
42- printf "
41+ talosctl completion bash > "${TALOS_HOME:-$HOME /.talos} /completion.bash.inc"
42+ printf '
4343 # talosctl shell completion
44- source '$ HOME/.talos/completion.bash.inc'
45- " >> $HOME/.bash_profile
44+ source "${TALOS_HOME:-$ HOME/.talos} /completion.bash.inc"
45+ ' >> $HOME/.bash_profile
4646 source $HOME/.bash_profile
4747# Load the talosctl completion code for fish[1] into the current shell
4848 talosctl completion fish | source
Original file line number Diff line number Diff line change @@ -20,8 +20,12 @@ type Path struct {
2020 WriteAllowed bool
2121}
2222
23- // GetTalosDirectory returns path to Talos directory (~/.talos).
23+ // GetTalosDirectory returns path to Talos directory ($TALOS_HOME or ~/.talos).
2424func GetTalosDirectory () (string , error ) {
25+ if path , ok := os .LookupEnv (constants .TalosHomeEnvVar ); ok && filepath .IsAbs (path ) {
26+ return path , nil
27+ }
28+
2529 home , err := os .UserHomeDir ()
2630 if err != nil {
2731 return "" , err
Original file line number Diff line number Diff line change @@ -602,6 +602,9 @@ const (
602602 // TalosConfigEnvVar is the environment variable for setting the Talos configuration file path.
603603 TalosConfigEnvVar = "TALOSCONFIG"
604604
605+ // TalosHomeEnvVar is the environment variable for setting the Talos state directory file path.
606+ TalosHomeEnvVar = "TALOS_HOME"
607+
605608 // APISocketPath is the path to file socket of apid.
606609 APISocketPath = SystemRunPath + "/apid/apid.sock"
607610
Original file line number Diff line number Diff line change @@ -432,11 +432,11 @@ talosctl completion SHELL [flags]
432432## Load the talosctl completion code for bash into the current shell
433433 source <(talosctl completion bash)
434434## Write bash completion code to a file and source if from .bash_profile
435- talosctl completion bash > ~ /.talos/completion.bash.inc
436- printf "
435+ talosctl completion bash > "${TALOS_HOME:-$HOME /.talos} /completion.bash.inc"
436+ printf '
437437 # talosctl shell completion
438- source '$ HOME/.talos/completion.bash.inc'
439- " >> $HOME/.bash_profile
438+ source "${TALOS_HOME:-$ HOME/.talos} /completion.bash.inc"
439+ ' >> $HOME/.bash_profile
440440 source $HOME/.bash_profile
441441# Load the talosctl completion code for fish[1] into the current shell
442442 talosctl completion fish | source
You can’t perform that action at this time.
0 commit comments