Skip to content

Commit

Permalink
Create ZSH cache dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarimarco committed Nov 9, 2023
1 parent c8d34e2 commit 808fd31
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
10 changes: 9 additions & 1 deletion .shells/.all/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ clone_git_repository_if_not_cloned_already() {
if [ -d "$destination_dir" ]; then
echo "$destination_dir already exists. Skipping..."
else
mkdir -p "$destination_dir"
mkdir -pv "$destination_dir"
echo "Cloning $git_repository_url in $destination_dir"
git clone "$git_repository_url" "$destination_dir"
fi
Expand Down Expand Up @@ -293,6 +293,14 @@ is_ci() {
fi
}

is_default_shell_zsh() {
if [ "${DEFAULT_SHELL_SHORT}" = "zsh" ]; then
return 0
else
return 1
fi
}

symlink_file() {
SOURCE_FILE_PATH="${1}"
DESTINATION_FILE_PATH="${2}"
Expand Down
3 changes: 3 additions & 0 deletions .shells/.zsh/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Make some commands not show up in history
export HISTORY_IGNORE="" # ZSH

# Set ZSH cache directory
export ZSH_CACHE_DIR="${USER_CACHE_DIRECTORY}/zsh"

# Don't run the ZSH theme configuration wizard
export POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
export ZSH_THEME_CONFIGURATION_PATH="$HOME"/.shells/.zsh/.p10k.zsh
19 changes: 13 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,13 @@ install_brew_formulae() {

setup_user() {
echo "Creating directories for the $TARGET_USER in $HOME"
mkdir -p "$HOME/bin"
mkdir -p "$HOME/Downloads"
mkdir -p "$HOME/workspaces"
mkdir -p "$HOME/workspaces-work"
mkdir -pv "$HOME/bin"
mkdir -pv "$HOME/Downloads"
mkdir -pv "$HOME/workspaces"
mkdir -pv "$HOME/workspaces-work"

mkdir -p "${GCLOUD_CONFIG_DIRECTORY}"
mkdir -pv "${GCLOUD_CONFIG_DIRECTORY}"
mkdir -pv "${USER_CACHE_DIRECTORY}"

touch "$HOME/.gitconfig-work"
}
Expand Down Expand Up @@ -554,12 +555,18 @@ setup_shell() {
fi

echo "Downloading fonts in ${USER_FONTS_DIRECTORY}"
mkdir -p "${USER_FONTS_DIRECTORY}"
mkdir -pv "${USER_FONTS_DIRECTORY}"
! [ -e "${USER_FONTS_DIRECTORY}/MesloLGS NF Regular.ttf" ] && curl -fsLo "${USER_FONTS_DIRECTORY}/MesloLGS NF Regular.ttf" https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
! [ -e "${USER_FONTS_DIRECTORY}/MesloLGS NF Bold.ttf" ] && curl -fsLo "${USER_FONTS_DIRECTORY}/MesloLGS NF Bold.ttf" https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
! [ -e "${USER_FONTS_DIRECTORY}/MesloLGS NF Italic.ttf" ] && curl -fsLo "${USER_FONTS_DIRECTORY}/MesloLGS NF Italic.ttf" https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
! [ -e "${USER_FONTS_DIRECTORY}/MesloLGS NF Bold Italic.ttf" ] && curl -fsLo "${USER_FONTS_DIRECTORY}/MesloLGS NF Bold Italic.ttf" https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

if is_default_shell_zsh; then
echo "Configuring ZSH"

mkdir -pv "${ZSH_CACHE_DIR}"
fi

echo "Shell configuration completed."
}

Expand Down

0 comments on commit 808fd31

Please sign in to comment.