Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore option is not working #45

Closed
reiwa opened this issue Oct 10, 2017 · 9 comments
Closed

ignore option is not working #45

reiwa opened this issue Oct 10, 2017 · 9 comments

Comments

@reiwa
Copy link

reiwa commented Oct 10, 2017

Am I misunderstanding how to use it? Or is this function at development stage?

$ micro-dev -i ./.idea

   ┌─────────────────────────────────────────────────────┐
   │                                                     │
   │   Micro is running!                                 │
   │                                                     │
   │   • Local:            http://localhost:3000         │
   │   • On Your Network:  http://xxx.xxx.xxx.xxx:3000   │
   │                                                     │
   │   Copied local address to clipboard!                │
   │                                                     │
   └─────────────────────────────────────────────────────┘


File changed: .idea/workspace.xml - Restarting server...
Restarted!

File changed: .idea/workspace.xml - Restarting server...
Restarted!

File changed: .idea/workspace.xml - Restarting server...
Restarted!
@tungv
Copy link
Contributor

tungv commented Oct 10, 2017

I know this is quite confusing, but ignore paths are absolute. So you need to use -i **/.idea

@leo leo closed this as completed Oct 10, 2017
@NetOpWibby
Copy link

This is not working for me. I even asked a mod on the Slack how to properly ignore files a few weeks ago and he had no idea. Frustrating.

@tungv
Copy link
Contributor

tungv commented Feb 1, 2018

Hi @NetOperatorWibby, can you please describe your project directory structure and what files you want to ignore?

@NetOpWibby
Copy link

Sure!

I have two folders at the base of my project, processed and raw. I dump files into the latter for transcoding or whatever and then they get dropped in the former. I want to ignore any activity those folders perform.

I tried micro-dev -l 5mb -i processed -i raw -p ${PORT:-3000} and variations, including adding a prefixed/appended / to the folder names and a couple hours ago, the tip you mentioned gave me an error about regex matching.

@tungv
Copy link
Contributor

tungv commented Feb 1, 2018

oh I see, this PR #54 broke the tip I gave above.
However, I believe you can achieve your requirement by only watching a whitelist of files.

Given your actual server logic is resided in src folder, you can run:

micro-dev src/index.js -l 5mb -w src -p ${PORT:-3000}

I'm also a heavy user of micro-dev and I agree with you that --ignore is not well-documented and its behavior changed a lot without notice.

@NetOpWibby
Copy link

My server logic is actually like this:

lib
 ... other logic
modules
 ... custom modules
processed
raw
.gitignore
index.js
package.json
README.md

I'm watching more than I'm ignoring so using the ignore flag would be ideal. I hadn't thought about watching though.

@tungv
Copy link
Contributor

tungv commented Feb 1, 2018

I usually put my own logic code into a sub directory for

  1. better searching (only search within that directory)
  2. cases like this, eg: watching, ignoring

If I understand correcly, the hot codes you want to watch for changes are inside lib and the root index.js. Since the file you start micro-dev with will always be watched, so you can just -w lib.

@NetOpWibby
Copy link

@tungv Forgot to reply, that seems to have worked! Thanks for the help man.

@tungv
Copy link
Contributor

tungv commented Feb 3, 2018

You're welcome pal

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

No branches or pull requests

4 participants