Skip to content

Commit

Permalink
fix(config): changed path to list of mounted devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Nov 28, 2023
1 parent feafb0d commit 18334bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion internal/linux/mounted.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type FileSystem struct {
}

func MountedList() (fss []FileSystem, err error) {
f, err := os.Open("/etc/mtab")
f, err := os.Open("/proc/mounts")
if err != nil {
return nil, err
}
Expand Down
11 changes: 2 additions & 9 deletions setting/config_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"github.com/wittano/filebot/internal/test"
"os"
"strings"
"testing"
)

Expand Down Expand Up @@ -35,12 +34,11 @@ func TestFailedLoadingConfig(t *testing.T) {
}

func TestGetTrashDir(t *testing.T) {
destDir := t.TempDir()
tempFile := test.CreateTempFile(t)

d := Directory{
Src: []string{tempFile},
Dest: destDir,
Dest: t.TempDir(),
MoveToTrash: true,
}

Expand All @@ -53,12 +51,7 @@ func TestGetTrashDir(t *testing.T) {
t.Fatal("MoveToTrash field is false")
}

var exp string
if strings.Contains(destDir, "/tmp") {
exp = fmt.Sprintf("/tmp/.Trash-%d/files", os.Getuid())
} else {
exp = fmt.Sprintf("%s/.local/share/.Trash-%d/files", os.Getenv("HOME"), os.Getuid())
}
exp := fmt.Sprintf("/tmp/.Trash-%d/files", os.Getuid())

if exp != res {
t.Fatalf("Trash dir is diffrent. Expected: %s, Actually: %s", exp, res)
Expand Down

0 comments on commit 18334bd

Please sign in to comment.