Use folder name in "meta exec"
See original GitHub issueIs there a way to get the current folder name, when running a command via meta exec?
Here’s a concrete example of what I’m hoping to accomplish (although, I could foresee a handful of other scenarios where this might be useful):
We have a meta-repo, containing a .meta file with a bunch of other projects that all depend on each other. These sub-repos contain .NET Standard projects, and I would like run a command to compile and publish (to a local feed) each project one-by-one.
For example…
rmdir %USERPROFILE%/.nuget/packages/<name-of-project> /s /q
dotnet pack src/<name-of-project>/<name-of-project>.csproj --configuration Release --output package
nuget push -Source %USERPROFILE%/.nuget/packages/ src/<name-of-project>/package/<name-of-project>.<version>.nupkg
Due to the folder structure we have in place, the command that I’m running changes depending on which project I’m building, if that makes sense.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to search files by directory and file name combo pattern
The first one will find all files with an .xml suffix with a path that contains a metadata directory. The files may be...
Read more >bash - How to go to each directory and execute a command?
This answer posted by Todd helped me. find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}'...
Read more >Query files/folders by metadata - API Reference
Query files/folders by metadata ... Create a search using SQL-like syntax to return items that match specific metadata. By default, this endpoint returns...
Read more >Loop through Folders & Files - YouTube
In this video I shown how do we loop through many folders folders and pass the folder name to child pipeline and iterate...
Read more >How do you output the filename in find command while using
you need only the first level in the folder structure; Use -type d , you need only folders; Use ! -name "." ,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Honestly, I should probably just wrap this up into a
metaplugin, to avoid copying this script into all my meta repos, then I could just run:I’ll add it to my pile. 😉
Closing since this is getting satisfied by a plugin.
@jeremyalan any chance you’d like to publish a
meta-nugetand have it linked to from the mainmetarepo?