Update install script #182

Merged
scottyeager merged 5 commits from development_installer into development 2025-11-14 10:23:57 +00:00
scottyeager commented 2025-10-15 23:50:14 +00:00 (Migrated from github.com)

This is a WIP to improve the install_v.sh script.

Done:

  • Use a main function
  • All global vars to top of file
  • Remove commented code
  • Split OS update from package install steps
  • Cleanup redis startup feature and put it behind a flag (we don't need redis when we are just building the hero cli, for example)

Comments and questions below.

This is a WIP to improve the `install_v.sh` script. Done: - Use a main function - All global vars to top of file - Remove commented code - Split OS update from package install steps - Cleanup redis startup feature and put it behind a flag (we don't need redis when we are just building the hero cli, for example) Comments and questions below.
scottyeager (Migrated from github.com) reviewed 2025-10-15 23:51:19 +00:00
@@ -4,2 +4,2 @@
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
#==============================================================================
# GLOBAL VARIABLES
scottyeager (Migrated from github.com) commented 2025-10-15 23:51:19 +00:00

Moved into main function below

Moved into main function below
scottyeager (Migrated from github.com) reviewed 2025-10-15 23:51:59 +00:00
@@ -381,3 +300,4 @@
# Remove v-analyzer path from rc files
for RC_FILE in ~/.zshrc ~/.bashrc; do
if [ -f "$RC_FILE" ]; then
scottyeager (Migrated from github.com) commented 2025-10-15 23:51:59 +00:00

Function was not in use

Function was not in use
scottyeager (Migrated from github.com) reviewed 2025-10-15 23:53:38 +00:00
@@ -400,0 +321,4 @@
function start_redis_service() {
echo "Attempting to start Redis service..."
# Check if redis-server is even installed
if ! command_exists redis-server; then
scottyeager (Migrated from github.com) commented 2025-10-15 23:53:37 +00:00

We already branch on OS when installing packages, so the package_install function is largely redundant. The apt command is confusing so is pulled to a function and explained.

We already branch on OS when installing packages, so the `package_install` function is largely redundant. The apt command is confusing so is pulled to a function and explained.
scottyeager (Migrated from github.com) reviewed 2025-10-15 23:58:28 +00:00
@@ -556,3 +403,3 @@
echo "V built successfully. Creating symlink..."
run_sudo ./v symlink
scottyeager (Migrated from github.com) commented 2025-10-15 23:58:28 +00:00

Why does this script do a system update, anyway? I never met an install script that wants to do this

Why does this script do a system update, anyway? I never met an install script that wants to do this
scottyeager (Migrated from github.com) reviewed 2025-10-15 23:59:15 +00:00
@@ -568,3 +414,4 @@
}
scottyeager (Migrated from github.com) commented 2025-10-15 23:59:15 +00:00

Why delete the lock files?

Why delete the lock files?
scottyeager (Migrated from github.com) reviewed 2025-10-16 00:00:52 +00:00
@@ -624,0 +500,4 @@
--start-redis)
START_REDIS=true
;;
*)
scottyeager (Migrated from github.com) commented 2025-10-16 00:00:52 +00:00

Why does this script create a new user on Arch (but no other Linux)?

Why does this script create a new user on Arch (but no other Linux)?
scottyeager (Migrated from github.com) reviewed 2025-10-16 00:12:10 +00:00
scottyeager (Migrated from github.com) commented 2025-10-16 00:12:10 +00:00

I tried to simplify things substantially here. There were some things I didn't understand, so maybe it cannot actually be this simple. Need to confirm whether systemctl/brew services really don't work in github actions runners.

Also I don't understand why we used systemctl start? This starts the service once but not again on boot

I tried to simplify things substantially here. There were some things I didn't understand, so maybe it cannot actually be this simple. Need to confirm whether systemctl/brew services really don't work in github actions runners. Also I don't understand why we used `systemctl start`? This starts the service once but not again on boot
scottyeager (Migrated from github.com) reviewed 2025-10-16 00:13:21 +00:00
scottyeager (Migrated from github.com) commented 2025-10-16 00:13:21 +00:00

Aside from condensing into main function, the top level flow is mostly unchanged aside from adding the flag for starting redis.

Aside from condensing into main function, the top level flow is mostly unchanged aside from adding the flag for starting redis.
scottyeager commented 2025-11-14 09:15:25 +00:00 (Migrated from github.com)

It works now in an Ubuntu container. We can check about Alpine later.

It works now in an Ubuntu container. We can check about Alpine later.
Sign in to join this conversation.
No description provided.