Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: `eval $(envkey-source [flags]) You'll need .env file in the current directory that includes ENVKEY=... (in development) or an ENVKEY environment variable set (on a server). You can also pass an ENVKEY directly (not recommended for real workflows): eval $(envkey-source ENVKEY [flags])`, Short: "Sets shell environment variables with an ENVKEY", Run: func(cmd *cobra.Command, args []string) { if printVersion { fmt.Println(version.Version) return } cacheEnabled := !shouldNotCache && shouldCache if !cacheEnabled && !shouldNotCache { if _, err := os.Stat(".env"); !os.IsNotExist(err) { cacheEnabled = true } } opts := fetch.FetchOptions{cacheEnabled, cacheDir, "envkey-source", version.Version, verboseOutput, timeoutSeconds, retries, retryBackoff} if len(args) > 0 { fmt.Println(shell.Source(args[0], force, opts, pamCompatible, dotEnvCompatible)) } else { godotenv.Load(envFile) envkey := os.Getenv("ENVKEY") fmt.Println(shell.Source(envkey, force, opts, pamCompatible, dotEnvCompatible)) } }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.