Added 'update' subcommand and small fix to the 'install' subcommand

This commit is contained in:
2024-09-09 11:33:48 +03:00
parent 6247c6eff7
commit bc489ebd23
2 changed files with 167 additions and 10 deletions
+7 -6
View File
@@ -14,12 +14,7 @@ type BPMConfigStruct struct {
Repositories []*Repository `yaml:"repositories"`
}
var BPMConfig BPMConfigStruct = BPMConfigStruct{
CompilationEnv: make([]string, 0),
SilentCompilation: false,
BinaryOutputDir: "/var/lib/bpm/compiled/",
CompilationDir: "/var/tmp/",
}
var BPMConfig BPMConfigStruct
func ReadConfig() {
if _, err := os.Stat("/etc/bpm.conf"); os.IsNotExist(err) {
@@ -29,6 +24,12 @@ func ReadConfig() {
if err != nil {
log.Fatal(err)
}
BPMConfig = BPMConfigStruct{
CompilationEnv: make([]string, 0),
SilentCompilation: false,
BinaryOutputDir: "/var/lib/bpm/compiled/",
CompilationDir: "/var/tmp/",
}
err = yaml.Unmarshal(bytes, &BPMConfig)
if err != nil {
log.Fatal(err)