From f83079f707807786bb6fe2fd75196ebec45d2ca5 Mon Sep 17 00:00:00 2001 From: Atsukoro1 Date: Fri, 2 Dec 2022 17:18:22 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Install=20script=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 17 ++++++++++++++--- src/args.rs | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 4732c24..cf12765 100755 --- a/install.sh +++ b/install.sh @@ -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 \ No newline at end of file diff --git a/src/args.rs b/src/args.rs index 9ec967d..c4335a7 100644 --- a/src/args.rs +++ b/src/args.rs @@ -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 } \ No newline at end of file