fix: dblab CLI location reported correctly for root
If current $USER is root, then we say "Downloaded to:" – and don't provide the path to CLI. This fixes it (saying "Downloaded to /usr/local/bin/").
For non-root users, the behavior is not changed.
Demo for root (linux, intel):
# curl -fsSL https://gitlab.com/postgres-ai/database-lab/-/raw/nik-cli-setup-root-message/engine/scripts/cli_install.sh | bash
Detected OS: linux, architecture: amd64
888 888 888 888
888 888 888 888
888 888 888 888
.d88888 88888b. 888 8888b. 88888b.
d88" 888 888 "88b 888 "88b 888 "88b
888 888 888 888 888 .d888888 888 888
Y88b 888 888 d88P 888 888 888 888 d88P
"Y88888 88888P" 888 "Y888888 88888P"
::::::::::::::::::::::::::::::::::::::::
SUCCESS! DLE CLI ("dblab") downloaded to:
/usr/local/bin/
::::::::::::::::::::::::::::::::::::::::
To start, run:
dblab init
For non-root (macos, silicon):
% curl -fsSL https://gitlab.com/postgres-ai/database-lab/-/raw/nik-cli-setup-root-message/engine/scripts/cli_install.sh | bash
Detected OS: darwin, architecture: arm64
888 888 888 888
888 888 888 888
888 888 888 888
.d88888 88888b. 888 8888b. 88888b.
d88" 888 888 "88b 888 "88b 888 "88b
888 888 888 888 888 .d888888 888 888
Y88b 888 888 d88P 888 888 888 888 d88P
"Y88888 88888P" 888 "Y888888 88888P"
::::::::::::::::::::::::::::::::::::::::
SUCCESS! DLE CLI ("dblab") downloaded to:
~/.dblab/dblab
Add it to $PATH or move manually:
sudo mv ~/.dblab/dblab /usr/local/bin/dblab
::::::::::::::::::::::::::::::::::::::::
To start, run:
dblab init
Edited by Nikolay Samokhvalov