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

Clean All Except? #38

Closed
pjdicke opened this issue Oct 11, 2013 · 6 comments
Closed

Clean All Except? #38

pjdicke opened this issue Oct 11, 2013 · 6 comments

Comments

@pjdicke
Copy link

pjdicke commented Oct 11, 2013

This is probably more of a feature request but it might be nice to do clean all except a file or dir?

@shama
Copy link
Member

shama commented Oct 12, 2013

Check out ! as that will negate a pattern. src: ['include/*.js', '!dont/include/*.js']. http://gruntjs.com/configuring-tasks#globbing-patterns

@shama shama closed this as completed Oct 12, 2013
@pjdicke
Copy link
Author

pjdicke commented Oct 12, 2013

Perfect! thanks

@AndersDJohnson
Copy link
Member

@shama Not working consistently for me. +1

@AndersDJohnson
Copy link
Member

Apparently you must use exclude the directory and all its children, e.g.:

{
  // ...
  files: {
    '!path/to/your/directory'
  , '!path/to/your/directory/**/*'
  }
  // ...
}

@shama
Copy link
Member

shama commented Oct 14, 2013

@adjohnson916 ! negates a pattern. Since folder/**/* doesn't match folder but rather the contents of that folder; prepending ! won't negate folder either.

@bvanheukelom
Copy link

You also seem to have to use object.files notation. I used an array of paths before and that didn't work.

Works:

clean: { files:[
    "web/client/**/*.js*",
    "!web/client/libs/**/*.js*",
     "web/packages/**/*.js*",
    "!web/packages/omm/**/*.js*",
    "web/server/**/*.js*",
    "web/tests/**/*.js*"
] }

Doesn't work:

clean: [
    "web/client/**/*.js*",
    "!web/client/libs/**/*.js*",
     "web/packages/**/*.js*",
    "!web/packages/omm/**/*.js*",
    "web/server/**/*.js*",
    "web/tests/**/*.js*"
]

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