skpm / path

A drop in replacement for the path NodeJS module
MIT License
3 stars 1 forks source link

Return undefined in resource bundle if pluginBundle doesn't exist #2

Closed huw closed 5 years ago

huw commented 5 years ago

There's a boolean typo in sketch-specifics.js which means resourcePath() always fails by returning undefined. This PR fixes that

Currently:

  if (typeof __command === 'undefined' || __command.pluginBundle()) {
    return undefined
  }

Here, __command.pluginBundle() will be truthy in situations where we want to use it later on. So the function will return undefined incorrectly — we can flip that boolean to be !__command.pluginBundle(), and the function will correctly fail.