aboutsummaryrefslogtreecommitdiff
path: root/internal/cmd/hook.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cmd/hook.go')
-rw-r--r--internal/cmd/hook.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/cmd/hook.go b/internal/cmd/hook.go
index 41cf88f2..cac19097 100644
--- a/internal/cmd/hook.go
+++ b/internal/cmd/hook.go
@@ -20,11 +20,11 @@ import (
"github.com/gogs/git-module"
+ "gogs.io/gogs/internal/conf"
"gogs.io/gogs/internal/db"
"gogs.io/gogs/internal/db/errors"
"gogs.io/gogs/internal/httplib"
"gogs.io/gogs/internal/mailer"
- "gogs.io/gogs/internal/setting"
"gogs.io/gogs/internal/template"
)
@@ -141,7 +141,7 @@ func runHookPreReceive(c *cli.Context) error {
}
var hookCmd *exec.Cmd
- if setting.IsWindows {
+ if conf.IsWindowsRuntime() {
hookCmd = exec.Command("bash.exe", "custom_hooks/pre-receive")
} else {
hookCmd = exec.Command(customHooksPath)
@@ -175,7 +175,7 @@ func runHookUpdate(c *cli.Context) error {
}
var hookCmd *exec.Cmd
- if setting.IsWindows {
+ if conf.IsWindowsRuntime() {
hookCmd = exec.Command("bash.exe", append([]string{"custom_hooks/update"}, args...)...)
} else {
hookCmd = exec.Command(customHooksPath, args...)
@@ -198,7 +198,7 @@ func runHookPostReceive(c *cli.Context) error {
// Post-receive hook does more than just gather Git information,
// so we need to setup additional services for email notifications.
- setting.NewPostReceiveHookServices()
+ conf.NewPostReceiveHookServices()
mailer.NewContext()
isWiki := strings.Contains(os.Getenv(db.ENV_REPO_CUSTOM_HOOKS_PATH), ".wiki.git/")
@@ -233,7 +233,7 @@ func runHookPostReceive(c *cli.Context) error {
}
// Ask for running deliver hook and test pull request tasks
- reqURL := setting.LocalURL + options.RepoUserName + "/" + options.RepoName + "/tasks/trigger?branch=" +
+ reqURL := conf.Server.LocalRootURL + options.RepoUserName + "/" + options.RepoName + "/tasks/trigger?branch=" +
template.EscapePound(strings.TrimPrefix(options.RefFullName, git.BRANCH_PREFIX)) +
"&secret=" + os.Getenv(db.ENV_REPO_OWNER_SALT_MD5) +
"&pusher=" + os.Getenv(db.ENV_AUTH_USER_ID)
@@ -258,7 +258,7 @@ func runHookPostReceive(c *cli.Context) error {
}
var hookCmd *exec.Cmd
- if setting.IsWindows {
+ if conf.IsWindowsRuntime() {
hookCmd = exec.Command("bash.exe", "custom_hooks/post-receive")
} else {
hookCmd = exec.Command(customHooksPath)