Beginning work on setup process

This commit is contained in:
gmemstr 2017-12-03 16:26:09 -08:00
parent d4361de8b9
commit 9031f22a8e
2 changed files with 29 additions and 0 deletions

20
setup.go Normal file
View file

@ -0,0 +1,20 @@
package main
import (
"database/sql"
"fmt"
"io"
"net/http"
"os"
_ "github.com/mattn/go-sqlite3"
)
func setup() {
fmt.Println("Initializing the database")
os.MkdirAll("assets/config/", 0755)
}
func Unzip(file string, dest string) {
}

View file

@ -10,12 +10,21 @@ import (
"fmt"
"log"
"net/http"
"os"
"github.com/gmemstr/pogo/router"
)
// Main function that defines routes
func main() {
// Check if this is the first time Pogo has been run
// with a lockfile
if _, err := os.Stat("run.lockfile"); os.IsNotExist(err) {
fmt.Println("This looks like your first time running Pogo,\ngive me a second to set myself up.")
setup()
}
// Start the watch() function in generate_rss.go, which
// watches for file changes and regenerates the feed
go watch()