|
@ -20,9 +20,18 @@ import ( |
|
|
"PackageManager/Variables" |
|
|
"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 { |
|
|
func writeManifestFile(path, name, version string) error { |
|
|
var ( |
|
|
var ( |
|
|
cmd *exec.Cmd |
|
|
|
|
|
manifest string |
|
|
manifest string |
|
|
filePath string |
|
|
filePath string |
|
|
e error |
|
|
e error |
|
@ -40,15 +49,7 @@ func writeManifestFile(path, name, version string) error { |
|
|
|
|
|
|
|
|
filePath = filepath.Join(path, "manifest.yml") |
|
|
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 { |
|
|
func CreatePackage() error { |
|
@ -135,6 +136,11 @@ func CreatePackage() error { |
|
|
return e |
|
|
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?
|
|
|
// TODO: Write this file to a better spot?
|
|
|
pkgFiles = append(pkgFiles, "/tmp/manifest.yml") |
|
|
pkgFiles = append(pkgFiles, "/tmp/manifest.yml") |
|
|
|
|
|
|
|
|