1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge branch 'cyingfan-master'

This commit is contained in:
Chris Cummer 2020-10-04 10:34:05 -07:00
commit 293ee105f7

View File

@ -37,7 +37,7 @@ func CreateFile(fileName string) (string, error) {
return "", err
}
filePath := fmt.Sprintf("%s/%s", configDir, fileName)
filePath := filepath.Join(configDir, fileName)
// Check if the file already exists; if it does not, create it
_, err = os.Stat(filePath)
@ -106,7 +106,7 @@ func LoadWtfConfigFile(filePath string) *config.Config {
// chmodConfigFile sets the mode of the config file to r+w for the owner only
func chmodConfigFile() {
configDir, _ := WtfConfigDir()
relPath := fmt.Sprintf("%s%s", configDir, WtfConfigFile)
relPath := filepath.Join(configDir, WtfConfigFile)
absPath, _ := expandHomeDir(relPath)
_, err := os.Stat(absPath)