#[Distribution] CLI bash completion instructions lead to yak shaving

1 messages · Page 1 of 1 (latest)

keen wave
#

(I don't see a tag for CLE or package distribution)

Annoyance:
installing the bash completions for the CLI on Ubuntu requires sudo.

...the current instructions for dagger v0.8.7 linux/amd64:

  BASH:
    1. Ensure that you install bash-completion using your package manager.
    2. Add dagger completion to your personal bash completions dir
      mkdir -p /bash-completion/completions
      dagger completion bash > /bash-completion/completions/dagger
sh info installed ./bin/dagger

leading to a twisty maze of permissions because my completions (system default) are currently in
drwxr-xr-x 2 root root 24576 Sep 23 00:41 /usr/local/share/bash-completion/completions
on Ubuntu 22.0.4 LTS

Workarounds:

  • I could sudo curl https://... but that is frowned upon by the security-minded.
  • I could install homebrew on Linux, but I happen to be a true believer.

Options:

  • If we had a package in apt or snap format we could get people to sudo
keen wave
#

another option that seems to work well for the "download and run script" approach is to copy to a home directory, then give instructions on how to optionally copy to a system-wide location:

2023/09/25 01:30:49 Extracted: /tmp/arkade-2017213398/syft
2023/09/25 01:30:49 Copying /tmp/arkade-2017213398/syft to /home/controlpl4n3/.arkade/bin/syft

Wrote: /home/controlpl4n3/.arkade/bin/syft (39.95MB)

# Add arkade binary directory to your PATH variable
export PATH=$PATH:$HOME/.arkade/bin/

# Test the binary:
/home/controlpl4n3/.arkade/bin/syft

# Or install with:
sudo mv /home/controlpl4n3/.arkade/bin/syft /usr/local/bin/
keen wave