Skip to content

Commit

Permalink
Create fastfetch.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmistry2000 committed Sep 19, 2024
1 parent 7bf6eb2 commit db37eae
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions fastfetch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh -e

# Define variables for the repository URL and the installation directory
FASTFETCH_REPO_URL="https://github.com/LinusDierheimer/fastfetch"
INSTALL_DIR="$HOME/fastfetch"

# Check if the installation directory exists, create it if it doesn't
if [ ! -d "$INSTALL_DIR" ]; then
echo "Cloning fastfetch repository into: $INSTALL_DIR"
git clone "$FASTFETCH_REPO_URL" "$INSTALL_DIR"
if [ $? -eq 0 ]; then
echo "Successfully cloned fastfetch repository"
else
echo "Failed to clone fastfetch repository"
exit 1
fi
else
echo "Repository already exists at: $INSTALL_DIR"
fi

# Navigate to the installation directory
cd "$INSTALL_DIR"

# Pull the latest changes from the repository
git pull

# Create a build directory and navigate into it
mkdir -p build
cd build

# Run cmake and make to compile fastfetch
cmake ..
make -j$(nproc)

# Install fastfetch
sudo make install

echo "fastfetch has been successfully installed"

0 comments on commit db37eae

Please sign in to comment.