This repository was archived by the owner on Oct 8, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 180
Automated the project setup with a single command for both Windows and Unix-based systems using Batch and Shell scripts with pacman support and comments #162
Open
Thepathakarpit
wants to merge
6
commits into
versotile-org:main
Choose a base branch
from
Thepathakarpit:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bbc7649
Create setup.sh
Thepathakarpit de45e0c
Create setup.bat
Thepathakarpit 381534c
Update setup.bat
Thepathakarpit eb6167f
Update setup.sh
Thepathakarpit 37b929c
Merge branch 'main' into main
Thepathakarpit 2037982
Merge branch 'main' into main
Thepathakarpit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/bin/bash | ||
|
|
||
| # 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both bash and zsh have # Grep for 'darwin':
if [[ $OSTYPE =~ "darwin" ]]; then
echo "macOS"
else
echo "not macOS"
fiThat 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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#!/usr/bin/env bashwould be "universally POSIX way" :-) Should work also in NixOS.