Skip to content

Commit

Permalink
fixed init of ignoreDirPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
dundee committed Jan 24, 2021
1 parent 84e9131 commit 01b0679
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ func (ui *UI) fileItemSelected(row, column int) {
func (ui *UI) deviceItemSelected(row, column int) {
selectedDevice := ui.table.GetCell(row, column).GetReference().(*analyze.Device)

if ui.ignoreDirPaths == nil {
ui.ignoreDirPaths = make(map[string]bool, 10)
}

for _, device := range ui.devices {
if device.Name != selectedDevice.Name && !strings.HasPrefix(selectedDevice.MountPoint, device.MountPoint) {
ui.ignoreDirPaths[device.MountPoint] = true
Expand Down
1 change: 0 additions & 1 deletion tui/tui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ func TestSelectDevice(t *testing.T) {
simScreen.SetSize(50, 50)

ui := CreateUI(simScreen, true)
ui.SetIgnoreDirPaths([]string{"/"})
ui.analyzer = analyzeMock
ui.ListDevices(getDevicesInfoMock)

Expand Down

0 comments on commit 01b0679

Please sign in to comment.