DopplerHQ / cli

The official CLI for interacting with your Doppler secrets and configuration.
https://docs.doppler.com
Apache License 2.0
214 stars 43 forks source link

[BUG] Cannot run executable found relative to current directory #415

Open danmichaelo opened 1 year ago

danmichaelo commented 1 year ago

Describe the bug

doppler run COMMAND fails if COMMAND is resolved from PATH and located relative to the current directory.

To Reproduce Steps to reproduce the behavior (minimal example):

  1. Create a hello-world bash script in ./bin and add the folder to PATH:
$ mkdir bin
$ cat <<EOF > ./bin/hello-world
#!/usr/bin/env bash
echo "Hello world"
EOF

$ chmod +x ./bin/hello-world
$ export PATH=./bin:$PATH
  1. Verify that we can run it directly:
$ hello-world
Hello world
  1. Try running it through Doppler:
$ doppler run hello-world
Doppler Error: exec: "hello-world": cannot run executable found relative to current directory

Note that it does work to run doppler run ./bin/hello-world, not just doppler run hello-world.

Expected behavior

It should work to run commands from PATH relative to the current directory.

CLI Version: Version v3.60.1

Additional context

Related bug with fix? https://github.com/syncthing/syncthing/issues/8499