Skip to content
This repository was archived by the owner on Jun 25, 2022. It is now read-only.
This repository was 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

@rfay

Description

@rfay
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions