Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert: fix missing assets due to symlinks pointing to the same source in different inputs #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

imjching
Copy link

@imjching imjching commented Oct 7, 2020

Symlinks implementation was added in 465fc29.
However, that did not account for the fact that multiple symlinks can point to
the same source. When that happens, we would still want assets to be generated
accordingly.

This commit fixes missing assets due to symlinks pointing to the same source
in different inputs. Consider the following example:

symlinkFile
└── file1 -> ../symlinkSrc/file1
symlinkFileDup
└── file1 -> ../symlinkSrc/file1
symlinkSrc
└── file1

If both symlinkFile and symlinkFileDup are passed to go-bindata, we would
still want both assets to be generated. The current implementation only
generates the first asset encountered, which is symlinkFile/file1.

That said, we still have a bug in which multiple symlinks in the same input
pointing to the same source won't be generated properly. Consider the
following case:

├── file1 -> ../symlinkSrc/file1
└── file2 -> ../symlinkSrc/file1

We would expect both file1 and file2 to be generated, but that is not the
case. Fixing this requires a much more thorough approach as the current
implementation does not support that easily. For now, we could generate those
two files by passing both file1 and file2 as separate inputs.

cc: @kevinburke

in different inputs

Symlinks implementation was added in kevinburke@465fc29.
However, that did not account for the fact that multiple symlinks can point to
the same source. When that happens, we would still want assets to be generated
accordingly.

This commit fixes missing assets due to symlinks pointing to the same source
in different inputs. Consider the following example:

symlinkFile
└── file1 -> ../symlinkSrc/file1
symlinkFileDup
└── file1 -> ../symlinkSrc/file1
symlinkSrc
└── file1

If both symlinkFile and symlinkFileDup are passed to go-bindata, we would
still want both assets to be generated. The current implementation only
generates the first asset encountered, which is symlinkFile/file1.

That said, we still have a bug in which multiple symlinks in the same *input*
pointing to the same source won't be generated properly. Consider the
following case:

├── file1 -> ../symlinkSrc/file1
└── file2 -> ../symlinkSrc/file1

We would expect both file1 and file2 to be generated, but that is not the
case. Fixing this requires a much more thorough approach as the current
implementation does not support that easily. For now, we could generate those
two files by passing both file1 and file2 as separate *inputs*.

Signed-off-by: Jay Lim <[email protected]>
@imjching imjching force-pushed the multiple-similar-symlinks branch from 979ead8 to e79f7cb Compare October 8, 2020 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants