Skip to content

Issue with -f: not resolving ~ or absolute paths #50

@ph5i

Description

@ph5i

Hey, I noticed that cook -f: doesn't seem to support ~ or absolute paths. When I try to use -f: ~/wordlists/test.txt or -f: /home/phsi/wordlists/test.txt, it just doesn't process the file. But if I specify the relative path like -f: test.txt or -f: ../wordlists/test.txt, it works fine.

Not a big deal since there's a workaround, but figured I'd report it.

Example:

# just to verify the file exists in both ~/tmp and /wordlists
[phsi@x] ~/tmp
❯ cat test.txt
test
database
lololol
yessir
word

[phsi@x] ~/tmp
❯ cat ~/wordlists/test.txt
test
database
lololol
yessir
word

# works fine when path is relative
[phsi@x] ~/tmp
❯ cook -f: test.txt -start get -end Data / start f.title end
/getTestData
/getDatabaseData
/getLolololData
/getYessirData
/getWordData

# also works fine when traversing paths
[phsi@x] ~/tmp
❯ cook -f: ../wordlists/test.txt -start get -end Data / start f.title end
/getTestData
/getDatabaseData
/getLolololData
/getYessirData
/getWordData

# does not work at all when using ~ or absolute path
[phsi@x] ~/tmp
❯ cook -f: ~/wordlists/test.txt -start get -end Data / start f.title end

[phsi@x] ~/tmp
❯ cook -f: /home/phsi/wordlists/test.txt -start get -end Data / start f.title end

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions