Skip to content

Commit

Permalink
Merge pull request #60 from Rajgupta36/feat/add-setup-script-for-linux
Browse files Browse the repository at this point in the history
Feat/add setup script for linux
  • Loading branch information
Pranav0-0Aggarwal authored Nov 17, 2024
2 parents 821fd41 + 3470aa1 commit b4ba06b
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 4 deletions.
20 changes: 17 additions & 3 deletions docs/frontend/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,23 @@ All commands executed below are with respect to the `frontend/` directory
```

2. Install the project dependencies:
```bash
npm install
```
- For Windows/Mac
```bash
npm install
```
- For Linux

1.Installing Dependencies
```bash
npm install
```
2.Grant executable permissions to the setup script:
```bash
chmod +x scripts/setup_env.sh
```
3.Run the dependencies script
```bash
npm run setup:linux
For more information on npm commands, see the [npm documentation](https://docs.npmjs.com/).
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"tauri": "tauri"
"tauri": "tauri",
"setup:linux": "cd scripts && ./setup_env.sh"
},
"dependencies": {
"@radix-ui/react-dropdown-menu": "^2.1.1",
Expand Down
67 changes: 67 additions & 0 deletions frontend/scripts/setup_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash


RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m'

# Update packages
echo -e "${YELLOW}Updating package lists...${NC}"
sudo apt-get update -y

# Required packages
packages=(
curl
build-essential
libgtk-3-dev
libwebkit2gtk-4.0-dev
libappindicator3-dev
wget
xz-utils
libssl-dev
libglib2.0-dev
libgirepository1.0-dev
pkg-config
software-properties-common
libjavascriptcoregtk-4.0-dev
libjavascriptcoregtk-4.1-dev
libsoup-3.0-dev
libwebkit2gtk-4.1-dev
)

# check and install required packages
echo -e "${YELLOW}Checking and installing required packages...${NC}"
for package in "${packages[@]}"; do
if dpkg -l | grep -q "^ii\s\+$package"; then
echo -e "${GREEN}$package is already installed.${NC}"
else
echo -e "${RED}$package is not installed. Installing...${NC}"
sudo apt-get install -y "$package"
fi
done

# Check and install Rust
if ! command -v rustc &> /dev/null; then
echo -e "${RED}Rust is not installed. Installing...${NC}"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
else
echo -e "${GREEN}Rust is already installed. Version: $(rustc --version)${NC}"
fi

# Check and install Node.js
if ! command -v node &> /dev/null; then
echo -e "${RED}Node.js is not installed. Installing...${NC}"
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
else
echo -e "${GREEN}Node.js is already installed. Version: $(node --version)${NC}"
fi

# Clean up
echo -e "${YELLOW}Cleaning up unused files...${NC}"
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*

echo -e "${GREEN}All required tools and libraries are installed!${NC}"

0 comments on commit b4ba06b

Please sign in to comment.