Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gruntfile string Negation

This should hopefully be a quick answer:

Given the following folder structure:

├── public
│   ├── app
|   |   ├── Folder A
|   |   |  ├──something.js   
    .
    .OTHER FOLDERS @ the app level
    .
    .

|   ├── libs
|   │   ├── libJS files here

Inside the initConfig I'm just trying to set up some variables for a task.

src: {
    js: [ 'public/**/*.js', '!public/**/*.spec.js', '!public/libs/', '!public/min/' ],
    libs: ['public/libs/*.js'],

What I want in english is for <%= src.js %> to be all the js files under the public folder minus the libs folder and the min folder but the above appears to select them all.

What am I doing wrong?

like image 576
Mike Fielden Avatar asked Mar 03 '26 05:03

Mike Fielden


1 Answers

To ignore all files in the libs and min folders:

js: [ 'public/**/*.js', '!public/**/*.spec.js', '!public/libs/**/*', '!public/min/**/*' ]

like image 131
go-oleg Avatar answered Mar 05 '26 18:03

go-oleg