Skip to content

change to directory of project path #86

@alanktwong

Description

@alanktwong

If I already have a mani.yaml configured for multiple projects, I would like to write a custom task that will change my current CLI (in my case darwin or linux) to the project path.

projects:
  example:
    path: .
    desc: A mani example

  pinto:
    path: frontend/pinto
    url: https://github.com/alajmo/pinto.git
    desc: A vim theme editor
    tags: [frontend, node]

tasks:
  go-here:
    desc: go to project path
    target:
      cwd: true  # what does this do?
    cmd: pushd "$(pwd)"

I would like mani run go-here -p pinto to change the current working directory of my shell to ./frontend/pinto

Testing this I always seem to return to working directory from where I executed mani.

One of the reasons driving this is that many multi-project development teams have repo-specific dependencies such as .npmrc, .python-version, .sdkmanrc which only kick in of the current working directory is that of the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions