foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

Absolute Path for Options #169

Open mou01 opened 6 years ago

mou01 commented 6 years ago

Fixes #164

marvinhuebner commented 5 years ago

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?

DanielRuf commented 4 years ago

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

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