mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
support ~ in rootDir as home directory
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ConfigStructure is structure of main configuration
|
||||
@@ -209,3 +210,8 @@ func SaveConfig(filename string, config *ConfigStructure) error {
|
||||
_, err = f.Write(encoded)
|
||||
return err
|
||||
}
|
||||
|
||||
// GetRootDir returns the RootDir with expanded ~ as home directory
|
||||
func (conf *ConfigStructure) GetRootDir() string {
|
||||
return strings.Replace(conf.RootDir, "~", os.Getenv("HOME"), 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user