mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
update config handling and add support for removing config
This commit is contained in:
@@ -46,6 +46,19 @@ func CreatePmgConfigDir() (string, error) {
|
||||
return dir, nil
|
||||
}
|
||||
|
||||
// RemovePmgConfigDir removes the PMG configuration directory and its contents.
|
||||
func RemovePmgConfigDir() error {
|
||||
dir, err := PmgConfigDir()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := os.RemoveAll(dir); err != nil {
|
||||
return fmt.Errorf("failed to remove config directory %s: %w", dir, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ConfigFilePath returns the absolute path to the main PMG config file (e.g., config.yml),
|
||||
// without creating any directories.
|
||||
func ConfigFilePath() (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user