xkpasswd-words.txt not found when run from a different folder from the executable
glowinthedark opened this issue · 2 comments
The file xkpasswd-words.txt
is not found when xkpasswd-go is run from another directory than the folder containing xkpasswd-words.txt
or xkpasswd-go
.
Copying xkpasswd-words.txt
to the same folder where xkpasswd-go
is located does not help and the same error is shown
readLines: open xkpasswd-words.txt: no such file or directory
Steps to reproduce:
go get -v -u github.com/vot/xkpasswd-go
cp $GOPATH/src/github.com/vot/xkpasswd-go/xkpasswd-words.txt $GOPATH/bin
xkpasswd-go
output:
readLines: open xkpasswd-words.txt: no such file or directory
If I cd
into GOPATH/bin
and run the command again then it works as expected:
cd %GOPATH/bin
xkpasswd-go
output:
unpotable.realisms.galvanoplasty
Thanks @glowinthedark for raising the issue.
I'll try to fix it soon - it shouldn't be too difficult to inject the directory in which binary is located in the dictionary path.
Hi @glowinthedark,
Once again thanks for raising both issues.
I just fixed this issue in this commit:
f95e2d0
Using os.Executable()
to get the location of executable file and appending the filename at the end now (instead of current working directory).
Let me know if this fixes it.
Vot