Skip to content

An option for running a command in all or some repositories #34

@cartoonist

Description

@cartoonist

There are some circumstances where one need to go through all or some cloned repositories and run some commands. Since dev hides the directory structure where repositories are stored from the user, it is reasonable to expect dev to do this.

There are two possible ways to implement this:

  1. dev ps can output full directory paths in a "non-prettified" format when the output is redirected to other tools such as xargs or parallel. The workflow would be something like this:

    $ dev ps | parallel --tag-string="{}:" -- git -C {} status
  2. The command can be passed to dev ps itself and it takes care of the execution which can be in parallel using tools like GNU Parallel internally. For instance:

    $ dev ps -- git submodule update --init
    # runs `git submodule update --init` command for all cloned repositories

    where -- is a delimiter indicating the end of options as described in Guideline 10 of POSIX Chapter 12.2 "Utility Syntax Guidelines". In this way, it might be possible to print a better output compared to the former way.

Considering #33, the command can be executed for a subset of repositories dictated by the filtering criteria.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions