You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
805 B
29 lines
805 B
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os/user"
|
|
"path/filepath"
|
|
)
|
|
|
|
func getHomeDir() string {
|
|
usr, err := user.Current()
|
|
if err != nil {
|
|
// TODO(d1): throw this error and show it on the frontend
|
|
panic(fmt.Sprintf("unable to read system user: %s", err))
|
|
}
|
|
return usr.HomeDir
|
|
}
|
|
|
|
var (
|
|
HomeDir = getHomeDir()
|
|
LocalDir = filepath.Join(HomeDir, ".local")
|
|
DataDir = filepath.Join(LocalDir, "snackbar")
|
|
HugoDir = filepath.Join(DataDir, "hugo")
|
|
SitesDir = filepath.Join(DataDir, "sites")
|
|
|
|
HugoVersion = "0.124.1"
|
|
HugoBinPath = filepath.Join(HugoDir, "hugo")
|
|
HugoTarPath = filepath.Join(HugoDir, fmt.Sprintf("hugo-%s.tar.gz", HugoVersion))
|
|
HugoReleaseURL = fmt.Sprintf("https://github.com/gohugoio/hugo/releases/download/v%s/hugo_extended_%s_linux-amd64.tar.gz", HugoVersion, HugoVersion)
|
|
)
|
|
|