func (af *AftoRepo) checkReqs() {
	err := afutil.CheckDpkg()
	if err != nil {
		log.Println(err)
		message, err := afutil.DetectPlatform()
		if err != nil {
			log.Fatalln(err)
		}
		fmt.Println(message)
	}
	log.Println("checking for deb files...")
	if af.Cmd == "new" {
		debs, err := afutil.CheckDeb()
		if err != nil {
			log.Fatalln(err)
		}
		log.Println(strconv.Itoa(len(debs)) + " deb file(s) found.")
		af.Debs = debs
	}
	if af.Cmd == "update" {
		if file != "" {
			deb, err := afutil.CheckDebWithFile(af.SingleDeb)
			if err != nil {
				log.Fatalln(err)
			}
			log.Println("deb file: \"" + filepath.Base(af.SingleDeb) + "\" found.")
			af.Debs = append(af.Debs, deb)
		}
		debs, err := afutil.CheckDebWithPath(af.Name)
		if err != nil {
			log.Fatalln(err)
		}
		log.Println(strconv.Itoa(len(debs)) + " deb file(s) found.")
		for _, d := range debs {
			af.Debs = append(af.Debs, af.Name+"/"+d)
		}
	}
}
checkReqs checks for dpkg and deb files.
package main
import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"os/exec"
	"path/filepath"
	"strconv"
	"strings"
	"github.com/docopt/docopt-go"
	"github.com/fatih/color"
	"github.com/gorilla/handlers"
	"github.com/hako/afto/afutil"
	"github.com/rjeczalik/notify"
)
var (
	version   = "0.2"
	buildHash = "0"
	buildDate string
	port     = "2468"
	repoPath = ""
	file     = ""
	aftoUnexpectedError = "an unexpected error occurred while updating. Make sure the path to the .deb file is correct"
)
var header = `
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>afto</title>
	</head>
	<body>
	<center>
	<img src="CydiaIcon.png"></img>
	<pre>afto</pre>
`
var footer = `
		<pre>generated by afto - the cydia repo generator/manager.</pre>
		<span><pre>` + version + ` | <a href="https://github.com/hako/afto">github</a></pre></span>
		</center>
	</body>
</html>
`
var usage = `afto ` + version + ` (` + buildHash + `)
built on: ` + buildDate + `
Usage:
  afto new <name>
  afto serve <dir> [-w | --watch] [-p <port> | --port <port>]
  afto update -r <name> [-f <file> | --file <file>] 
  afto [-c <file> | --control <file>]
  afto [-s <dir> | --sign <dir>]
options:
  -c, --control  Specify control file to use.
  -p, --port     Specify port number for afto.
  -h, --help     Show this screen.
  --version      Show version.
commands:
  new             Generate a new Cydia repo.
  serve           Serve the Cydia repo.`
type AftoRepo struct {
	Name      string
	Debs      []string
	Cmd       string
	SingleDeb string
}
func main() {
	if len(os.Args) == 1 {
		fmt.Println(usage)
		os.Exit(1)
	}
	opts, _ := docopt.Parse(usage, nil, true, "afto "+version+" ("+buildHash+")", false)
	log.SetPrefix("afto: ")
	log.SetFlags(2)
	if opts["-p"] == true || opts["--port"] == true {
		argport := opts["<port>"].(string)
		port = argport
	}
	if opts["-f"] == true || opts["--file"] == true {
		optsfile := opts["<file>"].(string)
		file = optsfile
	}
	if opts["-s"] == true || opts["--sign"] == true {
		repo := opts["<dir>"].(string)
		log.Println("signing repo \"" + repo + "\"")
		err := afutil.SignRepo(repo)
		if err != nil {
			log.Fatalln(err.Error())
		}
		log.Println("repo successfully signed!")
		os.Exit(0)
	}
	if opts["new"] == true {
		name := opts["<name>"].(string)
		af := &AftoRepo{Name: name, Cmd: "new"}
		af.newRepo()
		os.Exit(0)
	}
	if opts["update"] == true {
		var af *AftoRepo
		name := opts["<name>"].(string)
		if file != "" {
			af = &AftoRepo{Name: name, Cmd: "update", SingleDeb: file}
		} else {
			af = &AftoRepo{Name: name, Cmd: "update"}
		}
		af.updateRepo()
		os.Exit(0)
	}
	if opts["serve"] == true {
		var dir = opts["<dir>"].(string)
		finalPath, err := afutil.GetRepo(dir)
		if err != nil {
			log.Fatalln(err.Error())
			os.Exit(1)
		}
		repoPath = finalPath
		c := color.New(color.FgCyan).Add(color.Bold)
		c.Println("afto (αυτο) v" + version + " - the cydia repo generator/manager.")
		color.Cyan("(c) 2017 Wesley Hill (@hako/@hakobyte)")
		fmt.Println("afto is watching & listening for connections on port " + port)
		mx := http.FileServer(http.Dir(repoPath))
		loggingHandler := handlers.LoggingHandler(os.Stdout, mx)
		if opts["-w"] == true || opts["--watch"] == true {
			log.Println("watching the " + filepath.Base(repoPath) + " folder.")
			go func() {
				n := make(chan notify.EventInfo, 1)
				notify.Watch(repoPath, n, notify.Rename)
				defer notify.Stop(n)
				for {
					ev := <-n
					ev.Event()
					regenerateRepo(repoPath)
				}
			}()
		}
		go func() {
			err := http.ListenAndServe(":"+port, loggingHandler)
			if err != nil {
				fmt.Println("afto: error " + err.Error())
				os.Exit(1)
			}
		}()
		select {}
	}
}
func walkRepos() {
}