clean dir input
This commit is contained in:
parent
dfed84eb74
commit
536fc9e925
|
@ -64,6 +64,7 @@ func NewDisk(path string) (DiskFile, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func FindDisk(dir string, recursive bool, f *filter.Filter) (files Files, err error) {
|
func FindDisk(dir string, recursive bool, f *filter.Filter) (files Files, err error) {
|
||||||
|
dir = filepath.Clean(dir)
|
||||||
if dir == "." || dir == "" {
|
if dir == "." || dir == "" {
|
||||||
var d string
|
var d string
|
||||||
if d, err = os.Getwd(); err != nil {
|
if d, err = os.Getwd(); err != nil {
|
||||||
|
|
|
@ -78,11 +78,14 @@ func newModel(fs []files.File, width, height int, readonly, preselected, once bo
|
||||||
termheight: height,
|
termheight: height,
|
||||||
mode: mode,
|
mode: mode,
|
||||||
selected: map[string]bool{},
|
selected: map[string]bool{},
|
||||||
workdir: workdir,
|
|
||||||
files: fs,
|
files: fs,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if workdir != "" {
|
||||||
|
m.workdir = filepath.Clean(workdir)
|
||||||
|
}
|
||||||
|
|
||||||
rows := m.freshRows(preselected)
|
rows := m.freshRows(preselected)
|
||||||
|
|
||||||
columns := []table.Column{
|
columns := []table.Column{
|
||||||
|
|
Loading…
Reference in a new issue