Skip to content
Discussion options

You must be logged in to vote

command = "cd" tries to launch an executable named cd. In the shell you're using, cd is a shell builtin, so the error is about finding the command, rather than finding exists.

Set cwd on the task that should run inside that directory:

[tasks.list-exists]
cwd = "exists"
command = "ls"

Then run cargo make list-exists. I tested this on 0.37.24: your original cd task fails as shown, while this task lists the contents of exists.

If you need several shell commands after changing directory, keep them in one script:

[tasks.shell-example]
script_runner = "@shell"
script = '''
cd exists
pwd
ls
'''

The directory change is local to that script; it doesn't change your interactive shell's directory or …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by naskya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants