Skip to content

Working directory set to the command directory #2

Description

@serle

Describe the bug

The working directory seems to be the directory where the script can be found. I have a script in ./scripts i.e. where I write all my custom project scripts, but I am wanting its working directory to be ./migrations as it will alway output here.

To Reproduce

Steps to reproduce the behavior:

  1. Place a script in ./scripts e.g. migrate.sh with content
#!/bin/bash
set -xe

echo "migration content" > up.sql
  1. Add a line into the command section of the toml file e.g.
[commands]
add-migration = { cmd = "./scripts/add-migration.sh $name", args = ["name"], working_dir = "./migrations" }
  1. Invoke the command

cargo cmd add-migration name=xxx

  1. See error

./scripts/add-migration.sh: No such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions