Kiln » gitkiln Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master

can now print version when outside Git repo

Changeset f77dcece045c

Parent 2d93cd9edad2

by Benjamin Pollack

Changes to 2 files · Browse files at f77dcece045c Showing diff from parent 2d93cd9edad2 Diff from another changeset...

Change 1 of 3 Show Entire File main.go Stacked
 
116
117
118
 
 
 
 
119
120
121
 
295
296
297
298
 
299
300
301
 
309
310
311
 
 
312
313
314
 
116
117
118
119
120
121
122
123
124
125
 
299
300
301
 
302
303
304
305
 
313
314
315
316
317
318
319
320
@@ -116,6 +116,10 @@
  fmt.Println(documentation)  }   +func showVersion() { + fmt.Println(VERSION) +} +  func ensureArgs(n int, explanation string) bool {   if len(os.Args) < n {   fmt.Fprintln(os.Stderr, explanation) @@ -295,7 +299,7 @@
  }   }   case "version": - fmt.Println(version) + showVersion()   default:   showHelp()   } @@ -309,6 +313,8 @@
  if _, err := kiln.GitRoot(); err != nil {   if len(os.Args) == 2 && os.Args[1] == "help" {   showHelp() + return + } else if len(os.Args) == 2 && os.Args[1] == "version" {   return   } else {   fmt.Fprintln(os.Stderr, "git-kiln must be run from within a Git repository; see \"gitkiln help\"")
Change 1 of 1 Show Entire File version.go Stacked
 
1
2
3
 
 
1
2
 
3
@@ -1,3 +1,3 @@
 package main   -const version = "0.9.0" +var VERSION string