Added build command

This commit is contained in:
Eduard Urbach 2023-10-17 15:10:35 +02:00
parent 4f2bb677dc
commit 56bb014b51
Signed by: eduard
GPG key ID: 49226B848C78F6C8
7 changed files with 103 additions and 12 deletions

34
build/Build.go Normal file
View file

@ -0,0 +1,34 @@
package build
import "path/filepath"
// Build describes a compiler build.
type Build struct {
ExecutableName string
ExecutablePath string
WriteExecutable bool
}
// New creates a new build.
func New(directory string) (*Build, error) {
directory, err := filepath.Abs(directory)
if err != nil {
return nil, err
}
executableName := filepath.Base(directory)
build := &Build{
ExecutableName: executableName,
ExecutablePath: filepath.Join(directory, executableName),
WriteExecutable: true,
}
return build, nil
}
// Run parses the input files and generates an executable file.
func (build *Build) Run() error {
return nil
}