Various error fixes

This commit is contained in:
Wryn Wagner 2020-11-10 16:14:06 -07:00
parent eae9b43b76
commit c9a069fe5a
3 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,5 @@
#!/bin/zsh
# --- General ZSH Settings ----------------------------------- # --- General ZSH Settings -----------------------------------
HISTFILE=~/.histfile HISTFILE=~/.histfile
HISTSIZE=1000 HISTSIZE=1000

View File

@ -4,10 +4,16 @@ alias gdrive="RCLONE_GOOGLE_DRIVE_MOUNT"
RCLONE_GOOGLE_DRIVE_MOUNT() { RCLONE_GOOGLE_DRIVE_MOUNT() {
local RCLONE_REMOTE_NAME='google-drive'; local RCLONE_REMOTE_NAME='google-drive';
local MOUNT_POINT="$HOME/GoogleDrive";
[ -d $MOUNT_POINT ] \
&& { echo "connection already active at '$MOUNT_POINT'"; return 1; }
clear; clear;
figlet GOOGLE DRIVE CONNECTION | lolcat; figlet GOOGLE DRIVE CONNECTION | lolcat;
echo -e "\e[3m(C-c to close)\e[0m"; echo -e "\e[3m(C-c to close)\e[0m";
mkdir $MOUNT_POINT
rclone mount "$RCLONE_REMOTE_NAME:$1" "$HOME/GoogleDrive" rclone mount "$RCLONE_REMOTE_NAME:$1" "$HOME/GoogleDrive"
rmdir $MOUNT_POINT
} }

8
zsh/rc
View File

@ -21,14 +21,14 @@ esac
# --- set default editor ------------------------------------------- # --- set default editor -------------------------------------------
SET_PREFERRED_EDITOR() { SET_PREFERRED_EDITOR() {
local PREFERENCE="$PREFERRED_EDITOR"; # load preference from environment (vi vim) by default # load preference from environment (vi vim) by default
[ -z $PREFERENCE ] && { echo 'unable to find $PREFERRED_EDITOR environment variable'; return 1; } [[ -z $PREFERRED_EDITOR ]] && { echo 'unable to find $PREFERRED_EDITOR environment variable'; return 1; }
[[ $EDITOR == "${PREFERENCE[-1]}" ]] && [[ $VISUAL == "${PREFERENCE[-1]}" ]] && return 0; [[ $EDITOR == "${PREFERRED_EDITOR[-1]}" ]] && [[ $VISUAL == "${PREFERENCE[-1]}" ]] && return 0;
local AVAILABLE_EDITOR="$EDITOR"; local AVAILABLE_EDITOR="$EDITOR";
for program in $PREFERENCE; do which $program >/dev/null 2>&1 && AVAILABLE_EDITOR="$program"; done for program in $PREFERRED_EDITOR; do which $program >/dev/null 2>&1 && AVAILABLE_EDITOR="$program"; done
export EDITOR="$AVAILABLE_EDITOR"; export EDITOR="$AVAILABLE_EDITOR";
export VISUAL="$AVAILABLE_EDITOR"; export VISUAL="$AVAILABLE_EDITOR";