panini icon indicating copy to clipboard operation
panini copied to clipboard

Absolute Path for Options

Open mou01 opened this issue 7 years ago • 2 comments

Fixes #164

mou01 avatar May 03 '18 20:05 mou01

I've a similar situation there i have to check if the path is absolute. My solution has looked like this:

for (var i in dir) {
  var cwd = '';

  if (!path.isAbsolute(dir[i])) {
    cwd = process.cwd();
  }

  files = files.concat(glob.sync(path.join(cwd, dir[i], pattern)));
}

But i think your code does it fix it in a smarter way.

@gakimball is there a way to get this into?

marvinhuebner avatar Nov 06 '18 15:11 marvinhuebner

In another repo we had the same. Someone recommended path.resolve there.

See https://github.com/foundation/style-sherpa/pull/5#issuecomment-448876455

DanielRuf avatar Jan 01 '20 22:01 DanielRuf