Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working directory set to the command directory #2

Open
serle opened this issue Sep 3, 2023 · 0 comments
Open

Working directory set to the command directory #2

serle opened this issue Sep 3, 2023 · 0 comments

Comments

@serle
Copy link

serle commented Sep 3, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant