@@ -15,12 +15,7 @@ import (
15
15
"go.jetpack.io/launchpad/pkg/jetlog"
16
16
)
17
17
18
- type envOptions struct {
19
- projectConfigPath string
20
- }
21
-
22
18
func envCmd () * cobra.Command {
23
- opts := & envOptions {}
24
19
cmdCfg := & envcli.CmdConfig {}
25
20
command := & cobra.Command {
26
21
Use : "env" ,
@@ -31,15 +26,12 @@ func envCmd() *cobra.Command {
31
26
Securely stores and retrieves environment variables on the cloud.
32
27
Environment variables are always encrypted, which makes it possible to
33
28
store values that contain passwords and other secrets.
29
+
30
+ This command can only be run within a Launchpad project's directory (the directory
31
+ where launchpad.yaml is present)
34
32
` ),
35
33
PersistentPreRunE : func (cmd * cobra.Command , args []string ) error {
36
- var absProjectPath string
37
- var err error
38
- if opts .projectConfigPath == "" {
39
- absProjectPath , err = getProjectDir ()
40
- } else {
41
- absProjectPath , err = absPath ([]string {opts .projectConfigPath })
42
- }
34
+ absProjectPath , err := getProjectDir ()
43
35
if err != nil {
44
36
return errors .WithStack (err )
45
37
}
@@ -80,14 +72,6 @@ func envCmd() *cobra.Command {
80
72
},
81
73
}
82
74
83
- command .PersistentFlags ().StringVarP (
84
- & opts .projectConfigPath ,
85
- "project" ,
86
- "p" ,
87
- "" ,
88
- "Path to project config. If directory, we assume name is launchpad.yaml" ,
89
- )
90
-
91
75
command .AddCommand (
92
76
envcli .SetCmd (cmdCfg ),
93
77
envcli .RemoveCmd (cmdCfg ),
0 commit comments