Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Development directory : invalid regex #66

Closed
pierrelouisd4j opened this issue Jun 8, 2016 · 6 comments
Closed

Development directory : invalid regex #66

pierrelouisd4j opened this issue Jun 8, 2016 · 6 comments

Comments

@pierrelouisd4j
Copy link
Contributor

Hi guys,
I believe I found a bug in the regex which generate the meteor private directory in development mode.
https://github.com/lookback/meteor-emails/blob/master/lib/utils.js#L28

Indeed, I have a folder in my project containing ".meteor" wich is removed by the regex when the current path is generated.

My git dir
|--platform.meteor
   |----some init script
   |----meteor
         |------.meteor
         |------private

I know that the short answer is to rename my directory, but fixing this will probably save some time to other people in the future 😉

@johanbrook
Copy link
Contributor

Hi! Sorry for the late reply. Looking into tweaking that regex, would probably involve switching to:

const meteorRoot = process.cwd().replace(/(^\.meteor.*)/g, '');

@pierrelouisd4j
Copy link
Contributor Author

Maybe more something like that :

const meteorRoot = process.cwd().replace(/(\W)(\.meteor.*)/g, '$1');

@johanbrook
Copy link
Contributor

Right. Are you able to clone down the package repo locally into your packages directory and test it out?

@pierrelouisd4j
Copy link
Contributor Author

Hi, I tested this and it seems to work (it's better than my 1st solution)

const reg = new RegExp(path.sep+'\.meteor.*','g');
const meteorRoot = process.cwd().replace(reg, '');

@johanbrook
Copy link
Contributor

Cool! Fancy filing a PR and I can check it out locally too?

@johanbrook
Copy link
Contributor

Fixed in #67.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants