From 4d83fd4238e177d9327c760a5386bc53f25dedbb Mon Sep 17 00:00:00 2001 From: Michael Li Date: Mon, 17 Feb 2020 22:48:24 +0800 Subject: Use go-bindata to embed `public` and `templates` files into binary (#5920) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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: ᴜɴᴋɴᴡᴏɴ --- internal/db/migrations/v15.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/db/migrations') 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) -- cgit v1.2.3