@@ -9,34 +9,34 @@ import (
9
9
)
10
10
11
11
// GetDenylistFiles returns a list of ".deny" files found in
12
- // $XDG_CONFIG_HOME/ipfs/denylists and /etc/ipfs/denylists. The files are
13
- // sortered by their names in their respective folders .
12
+ // $XDG_CONFIG_HOME/ipfs/denylists and /etc/ipfs/denylists. The files are
13
+ // sortered by their names in their respective directories .
14
14
func GetDenylistFiles () ([]string , error ) {
15
15
// First, look for denylists in $XDG_CONFIG_HOME/ipfs/denylists
16
16
xdgConfigHome := os .Getenv ("XDG_CONFIG_HOME" )
17
17
if xdgConfigHome == "" {
18
18
xdgConfigHome = os .Getenv ("HOME" ) + "/.config"
19
19
}
20
20
ipfsDenylistPath := filepath .Join (xdgConfigHome , "ipfs" , "denylists" )
21
- ipfsDenylistFiles , err := GetDenylistFilesInFolder (ipfsDenylistPath )
21
+ ipfsDenylistFiles , err := GetDenylistFilesInDir (ipfsDenylistPath )
22
22
if err != nil {
23
23
return nil , err
24
24
}
25
25
26
26
// Then, look for denylists in /etc/ipfs/denylists
27
27
etcDenylistPath := "/etc/ipfs/denylists"
28
- etcDenylistFiles , err := GetDenylistFilesInFolder (etcDenylistPath )
28
+ etcDenylistFiles , err := GetDenylistFilesInDir (etcDenylistPath )
29
29
if err != nil {
30
30
return nil , err
31
31
}
32
32
33
33
return append (ipfsDenylistFiles , etcDenylistFiles ... ), nil
34
34
}
35
35
36
- // GetDenylistFilesInFolder returns a list of ".deny" files found in the given
37
- // folder . The files are sortered by their names. It returns an empty list and
38
- // no error if the folder does not exist.
39
- func GetDenylistFilesInFolder (dirpath string ) ([]string , error ) {
36
+ // GetDenylistFilesInDir returns a list of ".deny" files found in the given
37
+ // directory . The files are sortered by their names. It returns an empty list
38
+ // and no error if the directory does not exist.
39
+ func GetDenylistFilesInDir (dirpath string ) ([]string , error ) {
40
40
var denylistFiles []string
41
41
42
42
// WalkDir outputs files in lexical order.
0 commit comments