Can you please explain the meaning of this wildcard symbol?

We recently came across a part of our grunt file that was written by a former colleague. While the code functions correctly, the specific purpose of one segment remains a mystery to us!

Here is the enigmatic code snippet:

dist: {
    files: [{
        expand: true,
        cwd: '<%= config.tmp %>/styles/',
        src: '{,**/}*.css',
        dest: '<%= config.tmp %>/styles/'
    }]
}

The puzzling section is the {,**/} on line 5. It would be great to uncover its exact significance!

Answer №1

As stated in the provided documentation:

{} enables a comma-separated list of "or" expressions

Hence,

'{,**/}*.css',

will identify both *.css and **/*.css.

The initial pattern within the curly braces is deemed unnecessary, as the second one is already inclusive of .css files in the current/root directory.

Answer №2

{,**/}*.css signifies the utilization of Brace expansion in the specified pattern. Grunt employs the Minimatch library, which is capable of supporting this feature. Within the curly braces, the comma-separated patterns are first expanded into two distinct patterns, *.css and **/*.css in this instance. To validate your pattern, you can make use of globster.xyz

Answer №3

An excellent response from sotirios-delimanolis:

Understanding the Usage of ** (double star) in glob Syntax in JAVA

In summary, when using one star, nested paths will be ignored:

/a/a/a.css - will be ignored

The presence of a comma within the curly braces ensures that files or directories containing commas will not be ignored:

dsadsad,dasdsadas/a.css

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Exploring Grunt (node): Ways to Display Available Tasks

While I am accustomed to using Rakefile, Cakefile, and Jakefile, each of them offered a convenient method for listing the tasks available. For example: jake -T jake db:dump # Dump the database jake db:load # Populate the database ...and so ...

Execute with jQuery using Multiple Attribute Selector

I am attempting to input numeric values using a keyboard. My issue is as follows: the keyboard has an "Accept" button, and I have multiple text fields. I want to assign a different action for each text field. I attempted to use multiple attribute selector ...

Livereload.js is failing to load due to an invalid address

Snippet from Gruntfile.js: connect: { options: { port: 4000, hostname: 'localhost', livereload: 4002 }, livereload: { options: { open: true, middleware: function (connect) { return [ connect.st ...

Interactive Radial Menu Using Raphael JS

Greetings and thank you for taking the time to consider my predicament. I am currently working on creating an SVG menu using raphael, but unfortunately, geometry has never been my strong suit. Below is a visual representation of what I have managed to cre ...

When viewing the material-ui Chip component at normal zoom, a border outlines the element, but this border disappears when zoomed in or out, regardless of

Edit I have recently discovered a solution to the unusual problem I was facing with the material-ui Chip Component. By adding the line -webkit-appearance: none; to the root div for the Chip, the issue seems to resolve itself. However, this line is being a ...

The clash of interests between jQuery and Bootstrap

I'm facing a problem with conflicting jQuery and Bootstrap files in my header.php code. Whenever I include the jQuery file before the bootstrap.js file, it causes issues with the tabs on my website where clicking on them does not navigate me to the co ...

Generating JSON data with nested structure in Oracle SQL

I am struggling to generate a nested JSON object in Oracle SQL. While I have successfully created JSON objects with predefined hierarchy levels, the challenge lies in creating a dynamic nested structure using SQL or PLSQL. Below is the data from my table: ...

Rearrange elements within a div by clicking a button

I want to shuffle div elements with a click of a button using a dissolve animation in HTML5. An example of what I am looking for is similar to this website When you scroll on the page, there are links such as All, Intro, Solution. Clicking on any link sh ...

PHP and Bootstrap combine in this dynamic carousel featuring thumbnail navigation

Looking to create a dynamic bootstrap carousel with image thumbnails at the bottom? After exploring various code snippets and solutions, I stumbled upon this link. While the code worked, I found the thumbnails to be too small. Below are the functions I use ...

Transforming numerous key-value pairs into JSON formatting: utilizing sed in conjunction with an awk for loop

I am currently working with a data file that has 8 columns delimited by pipes. The last column contains an unpredictable number of key-value pairs, each separated by the equals sign and spaces between each pair. However, the challenge is that the values wi ...

What could be causing the unpredictable behavior of my Material UI Tabs component, where it seems to be overriding other

I am facing an issue with the styling of tabs in my React app dashboard that uses Material UI Tabs. Specifically, I have a tab in the dashboard that opens a modal for adding new users to the system. The modal itself also contains tabs, but no matter how I ...

Determine the mean value of an element within a specific column of arrays containing JSON data stored in a PostgreSQL database

Within my postgres table, I have a column that stores JSON data in the form of an array represented as a string. Here is an example: [ {"UsageInfo"=>"P-1008366", "Role"=>"Abstract", "RetailPrice"=>2, "EffectivePrice"=>0}, {"Role"=>"Text ...

What is the process for obtaining or creating scripts in the package.json file for Angular?

After browsing through the angular.io website, I'm unable to locate the package.json files in the additional documentation section. How exactly is this file created? Do I have to download it from elsewhere? ...

Manage user interface elements on mobile devices

When viewing my label and two textbox controls on a desktop, they are aligned horizontally. However, I want these textboxes to stack on top of each other when the user views the site on mobile. I am using a media query to adjust to a mobile view, and all o ...

Obtaining array value in JSON and incorporating it into a datatable

I have the following JSON data: { "aaData": [ [ { "displayValue": "Home Page", "link": "http://somelink.com" }, "London", "1983" ], [ { ...

The Ng-include tag does not provide highlighting for its text

Within an ng-include template, I have a div that is not highlighting when hovered over. Although the cursor changes to a pointer when hovering over the text, attempting to click and drag to highlight it results in nothing happening. This issue is signific ...

Making lightbox/dhtml appear in front of flash

After extensive research, I have come across numerous posts highlighting the importance of modifying the embed-tag with wmode="opaque" in order to force lightbox and other dhtml elements above flash content. Simply adjusting the z-index of the desired elem ...

Python: Adding an Element to a Dictionary

I'm struggling with merging a JSON object into an existing one. Despite adding the new object first in my code, it still appears at the bottom of the JSON structure. Here's an example of the current JSON structure... { "Header": { " ...

When attempting to use the jsonify method on a variable within an html file, the output is not displayed

Is it possible to store "jsonify" in a variable? I find the pure json format of "return jsonify(data)" unappealing, so I am looking for a way to enhance it using an HTML template with proper indentation. Here's the python code I have: from flask impo ...

Alignment of content layout across two wrapper elements

My goal is to achieve a specific layout where each pair of cards in a two-column layout is aligned based on the card with the largest content. Both cards share the same content layout and CSS. If you have any ideas or implementations that could help me ac ...