input edit: allow renaming the environment

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-06-09 11:34:51 -07:00
parent d19dd4d193
commit fb3e5bbd43

View File

@ -64,6 +64,7 @@ var editCmd = &cobra.Command{
if err := yaml.Unmarshal(data, &newState); err != nil { if err := yaml.Unmarshal(data, &newState); err != nil {
lg.Fatal().Err(err).Msg("failed to decode file") lg.Fatal().Err(err).Msg("failed to decode file")
} }
st.Name = newState.Name
st.Inputs = newState.Inputs st.Inputs = newState.Inputs
if err := workspace.Save(ctx, st); err != nil { if err := workspace.Save(ctx, st); err != nil {
lg.Fatal().Err(err).Msg("failed to save state") lg.Fatal().Err(err).Msg("failed to save state")