diff --git a/pkg/projectfile/yamlfield.go b/pkg/projectfile/yamlfield.go index 2217d37a4b..13b5691530 100644 --- a/pkg/projectfile/yamlfield.go +++ b/pkg/projectfile/yamlfield.go @@ -7,6 +7,8 @@ import ( "regexp" "github.com/ActiveState/cli/internal/errs" + "github.com/ActiveState/cli/internal/locale" + "github.com/ActiveState/cli/internal/osutils" "gopkg.in/yaml.v2" ) @@ -56,6 +58,11 @@ func (y *yamlField) Save(path string) error { } if err := os.WriteFile(path, out, 0664); err != nil { + if osutils.IsAccessDeniedError(err) { + return locale.WrapInputError(err, "err_migrate_projectfile_access_denied", + "Your project file at '{{.V0}}' is out of date, but State Tool does not have permission to update it. Please make it writeable or re-checkout the project to a writeable location.", + path) + } return errs.Wrap(err, "ioutil.WriteFile %s failed", path) }