aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-03-18 03:55:30 +0100
committerMax Magorsch <arzano@gentoo.org>2020-03-18 03:55:30 +0100
commitef2794e3cac14bf3e716f89a178ee15138e1aa62 (patch)
tree9ba24bb8a704d1053366cac27b24eb0829e292b5 /soko.go
downloadsoko-ef2794e3cac14bf3e716f89a178ee15138e1aa62.tar.gz
soko-ef2794e3cac14bf3e716f89a178ee15138e1aa62.tar.bz2
soko-ef2794e3cac14bf3e716f89a178ee15138e1aa62.zip
Initial commit containing v0.1.0 of Soko
This is a rewrite of packages.g.o based on postgres and git written in Go. Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'soko.go')
-rw-r--r--soko.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/soko.go b/soko.go
new file mode 100644
index 0000000..f414afe
--- /dev/null
+++ b/soko.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "fmt"
+ "os"
+ "soko/pkg/app"
+ "soko/pkg/portage"
+ "time"
+)
+
+func printHelp(){
+ fmt.Println("Please specific one of the following options:")
+ fmt.Println(" soko update -- update the database")
+ fmt.Println(" soko serve -- serve the application")
+}
+
+func isCommand(command string) bool{
+ return len(os.Args) > 1 && os.Args[1] == command
+}
+
+func main() {
+
+ time.Sleep(5 * time.Second)
+
+ if(isCommand("serve")) {
+ app.Serve()
+ }else if(isCommand("update")){
+ portage.Update()
+ }else{
+ printHelp()
+ }
+
+}