question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use folder name in "meta exec"

See original GitHub issue

Is 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:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremyalancommented, Jun 23, 2018

Honestly, I should probably just wrap this up into a meta plugin, to avoid copying this script into all my meta repos, then I could just run:

$ meta nuget publish

I’ll add it to my pile. 😉

0reactions
mateodelnortecommented, Nov 3, 2018

Closing since this is getting satisfied by a plugin.

@jeremyalan any chance you’d like to publish a meta-nuget and have it linked to from the main meta repo?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found