의 미러
https://github.com/quitesimpleorg/hs9001.git
synced 2024-11-22 04:07:52 +01:00
Resolve CWD arguments as absolute path
Previously when calling e.g 'hs9001 search -cwd .' we would search for a litteral '.' in the database. Now we resolve that argument relative to the CWD.
This commit is contained in:
부모
70e66f47ba
커밋
c480519fca
6
main.go
6
main.go
@ -314,7 +314,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
q := strings.Join(args, " ")
|
q := strings.Join(args, " ")
|
||||||
results := search(conn, "%"+q+"%", workDir, beginTimestamp, endTimeStamp, retVal)
|
cwdPath, err := filepath.Abs(workDir)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "Failed parse working directory path: %s\n", err.Error())
|
||||||
|
}
|
||||||
|
results := search(conn, "%"+q+"%", cwdPath, beginTimestamp, endTimeStamp, retVal)
|
||||||
|
|
||||||
previousCmd := ""
|
previousCmd := ""
|
||||||
for e := results.Front(); e != nil; e = e.Next() {
|
for e := results.Front(); e != nil; e = e.Next() {
|
||||||
|
불러오는 중...
Reference in New Issue
Block a user