mirror of
https://github.com/gmemstr/pogo.git
synced 2024-09-19 17:21:10 +01:00
Beginning work on setup process
This commit is contained in:
parent
d4361de8b9
commit
9031f22a8e
20
setup.go
Normal file
20
setup.go
Normal 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) {
|
||||
|
||||
}
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue