Fix VBScript error where a drive has duplicate drive letters #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've encountered a case where a different partitions of a single drive
were reported to have the exact same drive letter. This is obviously
weird unexpected behaviour in the first case, which seems to have
accidentally caused while manually fiddling with drive letters (maybe a
Windows bug?).
In any case, the symptom of the issue was the following error:
We have our own
List
data structure based onScripting.Dictionary
,which will complain with the error above if we try to set a key that
already exists.
Checking if an element already exists in the list is sadly not an easy
venture (mainly when dealing with non-scalar types). As a solution,
we've implemented a
Has()
method that only works with scalar types(for now), and use that to decide whether we add a drive letter to the
list of mount-points or not.
See: balena-io/etcher#1004 (comment)
Signed-off-by: Juan Cruz Viotti jviotti@openmailbox.org