Name property containing a dot that isn't an extension
- Dominant language
- JavaScript
- Stars
- 11
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
I was trying to get a small Liftoff project working with config files with any of the following file names:
```
.foo.config.js
foo.config.js
```
I was using the following config:
```js
const cli = new Liftoff({
name: 'foo',
extensions: require('interpret').extensions,
configFiles: {
'.foo.config': {
home: { path: '~' },
cwd: { path: '.' },
},
'foo.config': {
home: { path: '~' },
cwd: { path: '.' },
}
}
});
```
While looking into this why this wasn't loading, I discovered that due to gulpjs/fined@9a0e785eb05edb763cd90296be0850aa360cfaff the `.config` portion of the file name was being treated as the only allowed extension.
I fixed this locally with the following patch:
```diff
--- /fined/index.js 2019-08-17 17:02:25.000000000 -0700
+++ /fined/index.new.js 2019-08-17 17:02:38.000000000 -0700
@@ -65,7 +65,7 @@
basedir = path.resolve(parsed.root);
}
- if (parsed.ext) {
+ if (parsed.ext && extArr.includes(parsed.ext)) {
filePath = filePath.slice(0, -parsed.ext.length);
// This ensures that only the original extension is matched.
extArr = [parsed.ext];
```
Thougts? I can whip up a PR if you agree (and I get a chance to write a test)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.