This commit is contained in:
Iris Lightshard 2022-05-29 00:26:36 -06:00
parent b7e2dc3ab7
commit bea90e0e1c
Signed by: nilix
GPG key ID: 3B7FBC22144E6398
6 changed files with 249 additions and 252 deletions

View file

@ -2,9 +2,9 @@ package cmd
import (
"fmt"
"strings"
"nilfm.cc/git/quartzgun/auth"
"nilfm.cc/git/nirvash/config"
"nilfm.cc/git/quartzgun/auth"
"strings"
)
func Process(args []string, userStore auth.UserStore, cfg *config.Config) bool {

View file

@ -2,11 +2,11 @@ package config
import (
"fmt"
"runtime"
"os"
"strings"
"path/filepath"
"nilfm.cc/git/nirvash/adapter"
"os"
"path/filepath"
"runtime"
"strings"
)
type Config struct {
@ -20,7 +20,7 @@ type Config struct {
func GetConfigLocation() string {
home := os.Getenv("HOME")
appdata := os.Getenv("APPDATA")
switch (runtime.GOOS) {
switch runtime.GOOS {
case "windows":
return filepath.Join(appdata, "nirvash")
case "darwin":
@ -50,7 +50,6 @@ func Write(cfg *Config) error {
return writeConfig(cfg, filepath.Join(GetConfigLocation(), "nirvash.conf"))
}
func SetAdapter(cfg *Config, adptr string) {
switch adptr {
case "eureka":
@ -60,8 +59,6 @@ func SetAdapter(cfg *Config, adptr string) {
}
}
func IsNull(cfg *Config) bool {
return cfg.Adapter == nil || len(cfg.Root) == 0 || len(cfg.StaticRoot) == 0 || len(cfg.AssetRoot) == 0
}
@ -108,7 +105,7 @@ func RunWizard(cfg *Config) {
}
func ensureNonEmptyOption(buffer *string) {
for ;; {
for {
fmt.Scanln(buffer)
if len(strings.TrimSpace(*buffer)) != 0 {
break

View file

@ -1,15 +1,15 @@
package main
import (
"os"
"path/filepath"
"net/http"
"nilfm.cc/git/quartzgun/indentalUserDB"
"nilfm.cc/git/quartzgun/router"
"nilfm.cc/git/quartzgun/renderer"
"nilfm.cc/git/quartzgun/middleware"
"nilfm.cc/git/nirvash/cmd"
"nilfm.cc/git/nirvash/config"
"nilfm.cc/git/quartzgun/indentalUserDB"
"nilfm.cc/git/quartzgun/middleware"
"nilfm.cc/git/quartzgun/renderer"
"nilfm.cc/git/quartzgun/router"
"os"
"path/filepath"
)
func main() {