mirror of
https://github.com/Atsukoro1/ponyfetch.git
synced 2024-11-27 06:17:59 +01:00
fix: 🐛 Install script fix
This commit is contained in:
parent
efa52c72d3
commit
f83079f707
2 changed files with 15 additions and 4 deletions
17
install.sh
17
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
|
|
@ -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
|
||||
}
|
Loading…
Reference in a new issue