Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of directory paths containing spaces in setup.sh #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ BBlack='\033[1;30m' BRed='\033[1;31m' BGreen='\033[1;32m' BYellow='\033[1;33m
BBlue='\033[1;34m' BPurple='\033[1;35m' BCyan='\033[1;36m' BWhite='\033[1;37m'

## Directories ----------------------------
DIR=`pwd`
DIR="$(pwd)"
FONT_DIR="$HOME/.local/share/fonts"
ROFI_DIR="$HOME/.config/rofi"

# Install Fonts
install_fonts() {
echo -e ${BBlue}"\n[*] Installing fonts..." ${Color_Off}
echo -e "${BBlue}\n[*] Installing fonts..." "${Color_Off}"
if [[ -d "$FONT_DIR" ]]; then
cp -rf $DIR/fonts/* "$FONT_DIR"
cp -rf "$DIR/fonts/"* "$FONT_DIR"
else
mkdir -p "$FONT_DIR"
cp -rf $DIR/fonts/* "$FONT_DIR"
cp -rf "$DIR/fonts/"* "$FONT_DIR"
fi
echo -e ${BYellow}"[*] Updating font cache...\n" ${Color_Off}
echo -e "${BYellow}[*] Updating font cache...\n" "${Color_Off}"
fc-cache
}

# Install Themes
install_themes() {
if [[ -d "$ROFI_DIR" ]]; then
echo -e ${BPurple}"[*] Creating a backup of your rofi configs..." ${Color_Off}
echo -e "${BPurple}[*] Creating a backup of your rofi configs..." "${Color_Off}"
mv "$ROFI_DIR" "${ROFI_DIR}.${USER}"
fi
echo -e ${BBlue}"[*] Installing rofi configs..." ${Color_Off}
{ mkdir -p "$ROFI_DIR"; cp -rf $DIR/files/* "$ROFI_DIR"; }
echo -e "${BBlue}[*] Installing rofi configs..." "${Color_Off}"
{ mkdir -p "$ROFI_DIR"; cp -rf "$DIR/files/"* "$ROFI_DIR"; }

if [[ -f "$ROFI_DIR/config.rasi" ]]; then
echo -e ${BGreen}"[*] Successfully Installed.\n" ${Color_Off}
echo -e "${BGreen}[*] Successfully Installed.\n" "${Color_Off}"
exit 0
else
echo -e ${BRed}"[!] Failed to install.\n" ${Color_Off}
echo -e "${BRed}[!] Failed to install.\n" "${Color_Off}"
exit 1
fi
}
Expand Down