Skip to content

Commit

Permalink
spec: buildconf: add build directories to spec object
Browse files Browse the repository at this point in the history
Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
  • Loading branch information
metux committed Dec 10, 2023
1 parent b06c39d commit cb25e26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/buildconf/builddir.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ const (
BuildDirDist = BuildDir + "dist/"
)

const (
KeyBuildDir = "@builddir"
KeyBuildDirTmp = "@builddir/tmp"
KeyBuildDirDist = "@builddir/dist"
)

func xmkdir(d string) string {
os.MkdirAll(d, 0755)
d, _ = filepath.Abs(filepath.Clean(d))
Expand Down
3 changes: 3 additions & 0 deletions spec/buildconf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func (bc BuildConf) PkgNameTrans(id string) string {

func (bc BuildConf) Init() {
bc.DefaultPutStr("@features", "${features}")
bc.DefaultPutStr(KeyBuildDir, BuildDir)
bc.DefaultPutStr(KeyBuildDirTmp, BuildDirTmp)
bc.DefaultPutStr(KeyBuildDirDist, BuildDirDist)
}

func (bc BuildConf) Flags(build bool) SpecObj {
Expand Down

0 comments on commit cb25e26

Please sign in to comment.