mirror of
https://github.com/Atsukoro1/ponyfetch.git
synced 2025-02-17 09:54:22 +01:00
40 lines
869 B
Bash
40 lines
869 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
function makeDirectories() {
|
||
|
echo "Creating required directories..."
|
||
|
|
||
|
if [ ! -d "/usr/share/ponyfetch" ]; then
|
||
|
mkdir /usr/share/ponyfetch
|
||
|
mkdir /usr/share/ponyfetch/ponies
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
function compile() {
|
||
|
echo "Compiling ponyfetch..."
|
||
|
|
||
|
if [ ! -f "/usr/bin/ponyfetch" ]; then
|
||
|
cargo build --release
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
function moveFiles() {
|
||
|
echo "Moving files..."
|
||
|
|
||
|
if [ ! -f "/usr/bin/ponyfetch" ]; then
|
||
|
cp target/release/ponyfetch /usr/bin/ponyfetch
|
||
|
fi
|
||
|
|
||
|
toCopyCount=$(ls -1 /usr/share/ponyfetch/ponies/*.txt 2>/dev/null | wc -l)
|
||
|
dirCount=$(ls -1 ponies/*.txt 2>/dev/null | wc -l)
|
||
|
|
||
|
if [ $toCopyCount != $dirCount ]; then
|
||
|
cp -r ponies/* /usr/share/ponyfetch/ponies
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
echo "Thanks for choosing ponyfetch!"
|
||
|
echo "Let's begin installing!"
|
||
|
|
||
|
makeDirectories
|
||
|
compile
|
||
|
moveFiles
|