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