mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 01:12:24 +08:00
refactor(config) use util method
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
@ -146,7 +146,7 @@ func (i *Identity) DecodePrivateKey(passphrase string) (crypto.PrivateKey, error
|
||||
// Load reads given file and returns the read config, or error.
|
||||
func Load(filename string) (*Config, error) {
|
||||
// if nothing is there, fail. User must run 'ipfs init'
|
||||
if _, err := os.Stat(filename); os.IsNotExist(err) {
|
||||
if !u.FileExists(filename) {
|
||||
return nil, debugerror.New("ipfs not initialized, please run 'ipfs init'")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user