Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2016-04-07 17:49:12 +0300
committerMarin Jankovski <maxlazio@gmail.com>2016-04-07 17:49:12 +0300
commit7916df94fa9a4df1515e166f2213727de53085fe (patch)
tree5c2f6b7d53bb72e55ba1ce0a2841825162cd75ba /main.go
parent5718c3d05ff94d2ebe020eeac02678926b2fe000 (diff)
Reduce complexity.
Diffstat (limited to 'main.go')
-rw-r--r--main.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/main.go b/main.go
index 0c6d4ee9..ba7a25db 100644
--- a/main.go
+++ b/main.go
@@ -30,15 +30,11 @@ func appMain() {
flag.Parse()
- version := VERSION + "-" + REVISION
- if *showVersion {
- log.SetFlags(0)
- log.Printf(version)
- os.Exit(0)
- }
+ printVersion(*showVersion, VERSION)
log.Printf("GitLab Pages Daemon %s (%s)", VERSION, REVISION)
log.Printf("URL: https://gitlab.com/gitlab-org/gitlab-pages\n")
+
err := os.Chdir(*pagesRoot)
if err != nil {
log.Fatalln(err)
@@ -83,6 +79,14 @@ func appMain() {
runApp(config)
}
+func printVersion(showVersion bool, version string) {
+ if showVersion {
+ log.SetFlags(0)
+ log.Printf(version)
+ os.Exit(0)
+ }
+}
+
func main() {
log.SetOutput(os.Stderr)