ive been setting up Grunt for my web app to auto build it and im seeing paths like
/path/to/file/**/*.js
i understand what one wildcard means, but what does 2 in a row mean?
The double asterisks are placeholders or instructions to the recursive interpreter to go through the files and folders. It is a simple, recursive wildcard while only one asterisk means all without recursion.
It means that the directory App_Data is in the root of the current application. ASP.NET Web Site Paths.
From Wikipedia: “The tilde symbol is used to prefix hidden temporary files that are created when a document is opened in Windows. For example, when you open a Word document called “Document1. doc,” a file called “~$cument1. doc” is created in the same directory.
A relative path refers to a location that is relative to a current directory. Relative paths make use of two special symbols, a dot (.) and a double-dot (..), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy.
/path/to/file/**/*.js
matches any number of directories between /path/to/file/
and /*.js
. As opposed to /path/to/file/*/*.js
, which matches a single directory between /path/to/file/
and /*.js
.
this matchers called "glob pattern" they are widely used in shell script and in CLI tools like grunt or npm .they '**' means -- "Matches zero or more directories, but will never match the directories . and .. " you can read more in the docs glob pattern
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With