Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@echo off
REM Ensure script is run as administrator
net session >nul 2>&1
if not %errorLevel% == 0 (
echo This script must be run as administrator.
pause
exit /b 1
)

REM Install Scoop if not already installed
where scoop >nul 2>&1
if %errorLevel% neq 0 (
echo Installing Scoop...
powershell -Command "Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force; iex (new-object net.webclient).downloadstring('https://get.scoop.sh')"
set PATH=%PATH%;%USERPROFILE%\scoop\shims
)

REM Install necessary tools using Scoop
echo Installing dependencies...
scoop install git python llvm cmake curl

REM Install Python dependencies
echo Installing Python dependencies...
pip install mako

REM Build and run the project using Cargo
echo Building the project...
cargo run

echo Setup complete. Press any key to exit.
pause
38 changes: 38 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#!/usr/bin/env bash would be "universally POSIX way" :-) Should work also in NixOS.


# Ensure script is run as root
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root (use sudo)."
exit 1
fi

# Install necessary packages based on the package manager available
if [ -x "$(command -v apt-get)" ]; then
echo "Detected Debian-based system. Installing dependencies using apt-get."
sudo apt-get update
sudo apt-get install -y git python3-pip llvm cmake curl

elif [ -x "$(command -v yum)" ]; then
echo "Detected Red Hat-based system. Installing dependencies using yum."
sudo yum install -y git python3-pip llvm cmake curl

elif [ -x "$(command -v pacman)" ]; then
echo "Detected Arch-based system. Installing dependencies using pacman."
sudo pacman -Sy --needed git python-pip llvm cmake curl

elif [ -x "$(command -v brew)" ]; then
echo "Detected macOS. Installing dependencies using Homebrew."
brew install git python3 llvm cmake curl

else
echo "Unsupported OS or package manager. Please install dependencies manually."
exit 1
fi
Comment on lines +9 to +30

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both bash and zsh have OSTYPE environment variable, which can be used along the lines of:

# Grep for 'darwin':
if [[ $OSTYPE =~ "darwin" ]]; then
    echo "macOS"
else
    echo "not macOS"
fi

That said, upstream projects never should modify system state as part of any script. At most it could suggest packages but not perform any action. It's a security border IMHO that should not be crossed.
 


# Install Python dependencies
echo "Installing Python dependencies..."
pip3 install mako

# Build and run the project using Cargo
echo "Building the project..."
cargo run