Describe the bug
Running install.sh fails on non Ubuntu with the following error
Cloning the repository...
sed: can't read s/AUTHORIZATION_TOKEN = "[^"]*"/AUTHORIZATION_TOKEN = "redacted"/: No such file or directory
Please enter your Cloudflare account_id (from 'wrangler whoami' or the Cloudflare dashboard):
redacted
sed: can't read s/^account_id = .*/account_id = "redacted"/: No such file or directory
sed: can't read s/# STUDIO_USER = "admin"/STUDIO_USER = "admin"/: No such file or directory
sed: can't read s/# STUDIO_PASS = "123456"/STUDIO_PASS = "redacted"/: No such file or directory
To Reproduce
Run curl https://starbasedb.com/install.sh | bash on non BSD system and see error output.
Expected behavior
Install script runs without error and starbasedb deployed without error on Either BSD or Linux based system.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Ubuntu 22.04
Linux silver-slab 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Additional context
I believe the fix is simple enough, perform system check for BSD or Linux based system and use appropriate command syntax.
Something to the effect of this should be robust enough to handle different environments.
OS_TYPE=$(uname -s)
case "$OS_TYPE" in
Linux*)
# GNU utilities
SED_INPLACE="sed -i"
;;
Darwin*)
# BSD utilities (macOS)
SED_INPLACE="sed -i ''"
;;
*BSD*)
# Other BSD variants (FreeBSD, OpenBSD, etc)
SED_INPLACE="sed -i ''"
;;
*)
echo "Unknown operating system: $OS_TYPE"
exit 1
;;
esac
# run as following
$SED_INPLACE 's/# STUDIO_PASS = "123456"/STUDIO_PASS = "'"$ADMIN_PASS"'"/' wrangler.toml
Describe the bug Running
install.sh
fails on non Ubuntu with the following errorTo Reproduce Run
curl https://starbasedb.com/install.sh | bash
on non BSD system and see error output.Expected behavior Install script runs without error and starbasedb deployed without error on Either BSD or Linux based system.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context I believe the fix is simple enough, perform system check for BSD or Linux based system and use appropriate command syntax.
Something to the effect of this should be robust enough to handle different environments.