-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Config): Fix linter issues for the Config file package
- Loading branch information
Showing
1 changed file
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
/* | ||
Package config provides functionality for reading, creating and modifying configuration files for CommitSense. | ||
This file includes utility functions for interacting with configuration files. | ||
Copyright © 2023 HENRI REMONEN <[email protected]> | ||
*/ | ||
package config | ||
|
||
import ( | ||
|
@@ -8,6 +15,7 @@ import ( | |
"github.com/spf13/viper" | ||
) | ||
|
||
// UserHomeDir represents the path to the user's home directory. | ||
var UserHomeDir string | ||
|
||
var ( | ||
|
@@ -32,8 +40,8 @@ func init() { | |
UserHomeDir = homeDir | ||
} | ||
|
||
// ConfigFileExists checks if the configuration file exists in the user's home directory. | ||
func ConfigFileExists() bool { | ||
// Exists checks if the configuration file exists in the user's home directory. | ||
func Exists() bool { | ||
if fi, err := os.Stat(path.Join(UserHomeDir, configFile)); err != nil || fi.IsDir() { | ||
return false | ||
} | ||
|
@@ -71,4 +79,4 @@ func CreateDefaultConfig() error { | |
CommitTypes: defaultCommitTypes, | ||
SkipCITypes: defaultSkipCITypes, | ||
}) | ||
} | ||
} |