diff options
author | Michael Li <alimy@gility.net> | 2020-02-17 22:48:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-17 22:48:24 +0800 |
commit | 4d83fd4238e177d9327c760a5386bc53f25dedbb (patch) | |
tree | 4c730773e80d0110a449392513b88d70cf1e85fe /internal/db/migrations/v15.go | |
parent | fd14ad6ce9bfe14e2a551845f27058ecf3853d74 (diff) |
Use go-bindata to embed `public` and `templates` files into binary (#5920)
* fixed private repositories are hidden in the organization's view
* use go-bindata integrate public and templates files to gogs binary
* optimize Dockerfile don't COPY public and templates files
* use kevinburke's go-bindata to generate assets code
* reset develepment as default run mode in configure file
* optimize generated assets code relayout and help function
* fixed code format
* Update conf/app.ini
* assets: add LICENSE headers
* Some housekeeping
* assets/public: simplify code logic
* assets/templates: simplify code logic
* cmd/web: more concise variable names
* Minor changes
* Add custom public and templates support back
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
Diffstat (limited to 'internal/db/migrations/v15.go')
-rw-r--r-- | internal/db/migrations/v15.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/db/migrations/v15.go b/internal/db/migrations/v15.go index 7f3b9504..d9c913df 100644 --- a/internal/db/migrations/v15.go +++ b/internal/db/migrations/v15.go @@ -12,9 +12,10 @@ import ( "strings" "github.com/unknwon/com" - "xorm.io/xorm" log "gopkg.in/clog.v1" + "xorm.io/xorm" + "gogs.io/gogs/internal/osutil" "gogs.io/gogs/internal/setting" ) @@ -80,7 +81,7 @@ func generateAndMigrateGitHooks(x *xorm.Engine) (err error) { // Gogs didn't allow user to set custom update hook thus no migration for it. // In case user runs this migration multiple times, and custom hook exists, // we assume it's been migrated already. - if hookName != "update" && com.IsFile(oldHookPath) && !com.IsExist(customHookDir) { + if hookName != "update" && osutil.IsFile(oldHookPath) && !com.IsExist(customHookDir) { os.MkdirAll(customHookDir, os.ModePerm) if err = os.Rename(oldHookPath, newHookPath); err != nil { return fmt.Errorf("move hook file to custom directory '%s' -> '%s': %v", oldHookPath, newHookPath, err) |