Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Bug: packr2 (compiled) finds contents of relative subdirectory instead of packed files #222

Open
rfay opened this issue Jul 29, 2019 · 0 comments

Comments

@rfay
Copy link

rfay commented Jul 29, 2019

  • If you use a directory name (perhaps "assets") in your code where the bundled files are supposed to be.
  • But then you run the built executable in a directory that happens to have a directory of that name.
  • The files in "assets" in the current directory are listed, instead of the expected files that were bundled into the executable.

A complete and easy demonstration of this (severe) bug is in https://github.com/rfay/packr2_bug,

To recreate this:

  1. Build packr2_bug: go install packr2_bug.go
  2. Run ~/go/bin/packr2_bug, and you'll see the expected bundled file, "junk-from-packr2.txt"
  3. Now mkdir -p /tmp/junk/assets && cd /tmp/junk && touch assets/this-was-in-pwd-assets.txt. You've created a "junk" directory with a subdirectory named "assets", which has a file named "this-was-in-pwd-assets.txt" in it.
  4. Run ~/bin/packr2_bug. The output will be the pwd's assets subdirectory ("this-was-in-pwd-assets.txt") instead of the bundled file.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant