diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2016-05-23 17:24:40 -0300 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-05-23 13:24:40 -0700 |
commit | 12d30255a789df43672617c549bd3db2d6a4b4f6 (patch) | |
tree | a9d5584d5d45a7a21da76f5d04dba6cbca16fb2c | |
parent | 7826eae452360913b7c9e476566dc30601270c75 (diff) | |
download | gitea-12d30255a789df43672617c549bd3db2d6a4b4f6.tar.gz gitea-12d30255a789df43672617c549bd3db2d6a4b4f6.zip |
Add comment note (#3093)
-rw-r--r-- | models/admin.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/models/admin.go b/models/admin.go index 3d27e554d0..c2db03dafe 100644 --- a/models/admin.go +++ b/models/admin.go @@ -74,9 +74,11 @@ func CreateRepositoryNotice(desc string) error { // creates a system notice when error occurs. func RemoveAllWithNotice(title, path string) { var err error + // workaround for Go not being able to remove read-only files/folders: https://github.com/golang/go/issues/9606 + // this bug should be fixed on Go 1.7, so the workaround should be removed when Gogs don't support Go 1.6 anymore: + // https://github.com/golang/go/commit/2ffb3e5d905b5622204d199128dec06cefd57790 if setting.IsWindows { - // usually Go automatically converts "/" to "\" in path on Windows - // but since we are running it manually, it's better to convert to prevent problems + // converting "/" to "\" in path on Windows path = strings.Replace(path, "/", "\\", -1) err = exec.Command("cmd", "/C", "rmdir", "/S", "/Q", path).Run() } else { |