Skip to content

Commit

Permalink
performing a pull before adding an environment or setting root in a p…
Browse files Browse the repository at this point in the history
…rofile
  • Loading branch information
shibme committed Feb 29, 2024
1 parent 389bcc7 commit 7b5e6f1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/profiles/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ func (profile *Profile) PutEnv(env *environments.Environment) error {
if profile.isWriteDenied() {
return errChangesNotAllowedInGitProfile
}
if profile.repo != nil {
if err := profile.Pull(); err != nil {
return err
}
}
envManifest, err := profile.getEnvManifest()
if err != nil {
return err
Expand All @@ -123,6 +128,11 @@ func (profile *Profile) SetRoot(env *environments.Environment) error {
if profile.isWriteDenied() {
return errChangesNotAllowedInGitProfile
}
if profile.repo != nil {
if err := profile.Pull(); err != nil {
return err
}
}
envManifest, err := profile.getEnvManifest()
if err != nil {
return err
Expand Down

0 comments on commit 7b5e6f1

Please sign in to comment.