fix: 🐛 Install script fix

This commit is contained in:
Atsukoro1 2022-12-02 17:18:22 +01:00
parent efa52c72d3
commit f83079f707
2 changed files with 15 additions and 4 deletions

View file

@ -1,5 +1,10 @@
#!/bin/bash
function configure() {
echo "Configuring..."
rustup default stable
}
function makeDirectories() {
echo "Creating required directories..."
@ -20,9 +25,9 @@ function compile() {
function moveFiles() {
echo "Moving files..."
if [ ! -f "/usr/bin/ponyfetch" ]; then
cp target/release/ponyfetch /usr/bin/ponyfetch
fi
rm -rf /usr/bin/ponyfetch
rm -rf /bin/ponyfetch
cp ./target/release/ponyfetch /usr/bin/ponyfetch
toCopyCount=$(ls -1 /usr/share/ponyfetch/ponies/*.txt 2>/dev/null | wc -l)
dirCount=$(ls -1 ponies/*.txt 2>/dev/null | wc -l)
@ -32,9 +37,15 @@ function moveFiles() {
fi
}
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
echo "Thanks for choosing ponyfetch!"
echo "Let's begin installing!"
configure
makeDirectories
compile
moveFiles

View file

@ -9,7 +9,7 @@ pub struct Args {
/// Defines what ASCII pony to print.
pub pony: String,
#[clap(short, long, required = false, default_value = "0")]
#[clap(short, long, required = false, default_value = "green")]
/// Defines what color to print the output it
pub color: String
}