aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/path.go
blob: 8211478bb75d38f5cc1a043153e360eb659414a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package internal

import (
	"log"
	"path"

	"git.gensokyo.uk/security/fortify/internal/fmsg"
)

var (
	fsu = compPoison
)

func MustFsuPath() string {
	if name, ok := checkPath(fsu); ok {
		return name
	}
	fmsg.BeforeExit()
	log.Fatal("invalid fsu path, this program is compiled incorrectly")
	return compPoison
}

func checkPath(p string) (string, bool) { return p, p != compPoison && p != "" && path.IsAbs(p) }