platformsh / cli

The unified tool for managing your Platform.sh services from the command line.
https://docs.platform.sh/administration/cli.html
MIT License
16 stars 6 forks source link

Expects that platformsh/upsun binary is in PATH #147

Open shyim opened 8 months ago

shyim commented 8 months ago
❯ ../upsun push
Selected project: test (ismaivrbmrny6)

Pushing HEAD to the environment main (type: production) of project test (ismaivrbmrny6)

Are you sure you want to continue? [Y/n] Y

  fish: Unknown command: upsun
  fish:
  upsun ssh-cert:load --refresh-only --yes --quiet 2>/dev/null
  ^~~~^

Upsun should not expect himself in the PATH and should use the called binary aka arg 0 for further execution.

akalipetis commented 7 months ago

Using arg 0 would not work in that case, as the SSH daemon (that needs to refresh the SSH keys) will not be in the same directory as you when executing that command.

An alternative approach would be to try to get the absolute path and use that if it's a command that needs to use it (ie certificate refresh, calling on itself, etc, while keeping the existing binary config option for documentation purposes.

WDYT @pjcdawkins?

pjcdawkins commented 7 months ago

Note the listed error is actually upsun calling ssh, and then ssh calling upsun. There wouldn't be a way to use arg 0 in this case. Perhaps we could configure SSH with an absolute path to upsun, but that could be fragile.

shyim commented 7 months ago

check that the dir is in PATH and add when not?