Browse Source

Make editing manifest optional for LFS builds

feature/create-install-pkgs
Tovi Jaeschke-Rogers 3 years ago
parent
commit
b63f1dd70d
1 changed files with 16 additions and 10 deletions
  1. +16
    -10
      Client/Package/CreatePackage.go

+ 16
- 10
Client/Package/CreatePackage.go View File

@ -20,9 +20,18 @@ import (
"PackageManager/Variables"
)
func editManifestFile(filePath string) error {
var (
cmd *exec.Cmd
)
cmd = exec.Command(Variables.Editor, filePath)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
return cmd.Run()
}
func writeManifestFile(path, name, version string) error {
var (
cmd *exec.Cmd
manifest string
filePath string
e error
@ -40,15 +49,7 @@ func writeManifestFile(path, name, version string) error {
filePath = filepath.Join(path, "manifest.yml")
e = ioutil.WriteFile(filePath, []byte(manifest), 0644)
if e != nil {
return e
}
cmd = exec.Command(Variables.Editor, filePath)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
return cmd.Run()
return ioutil.WriteFile(filePath, []byte(manifest), 0644)
}
func CreatePackage() error {
@ -135,6 +136,11 @@ func CreatePackage() error {
return e
}
e = editManifestFile(filepath.Join("/tmp/", "manifest.yml"))
if e != nil {
fmt.Println(Color.Fatal(e.Error))
}
// TODO: Write this file to a better spot?
pkgFiles = append(pkgFiles, "/tmp/manifest.yml")


Loading…
Cancel
Save