From ec53a7ed7f68f81be0659786bb88e666c7ab0afa Mon Sep 17 00:00:00 2001 From: Noah Masur Date: Sun, 15 Nov 2020 09:47:29 -0500 Subject: [PATCH] clean up bootstrap scripts and notes --- fish.configlink/functions/notes.fish | 16 +++++------ scripts/bootstrap | 41 ---------------------------- scripts/{ => saved}/backup_keybase | 0 scripts/{ => saved}/install_ohmyzsh | 0 scripts/{ => saved}/setup_keybase | 0 scripts/saved/unused_bootstraps | 40 +++++++++++++++++++++++++++ 6 files changed, 48 insertions(+), 49 deletions(-) rename scripts/{ => saved}/backup_keybase (100%) rename scripts/{ => saved}/install_ohmyzsh (100%) rename scripts/{ => saved}/setup_keybase (100%) create mode 100755 scripts/saved/unused_bootstraps diff --git a/fish.configlink/functions/notes.fish b/fish.configlink/functions/notes.fish index 3c8fa67..faa2884 100644 --- a/fish.configlink/functions/notes.fish +++ b/fish.configlink/functions/notes.fish @@ -33,19 +33,19 @@ function notes --description "Notes functions" cd - end - function wiki --description "Open vimwiki file" + function note --description "Edit or create a note" -a "filename" cd $HOME/Documents/notes - set file (ls | fzf) - if [ $status -eq 0 ] - vim $file + if test -n "$filename" + vim $filename.md + else + set file (ls | fzf) + if [ $status -eq 0 ] + vim $file + end end cd - end - function note --description "Edit or create a note" - vim ~/Documents/notes/$argv[1].md - end - abbr -a sn 'syncnotes' function syncnotes --description "Full git commit on notes" cd $HOME/Documents/notes diff --git a/scripts/bootstrap b/scripts/bootstrap index d0b3e12..0003fda 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,35 +4,6 @@ DOTS=$(dirname "$0")/.. cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1) DOTS="$PWD" -check_for_zsh() { - if ! (echo "$SHELL" | grep zsh > /dev/null) - then - echo "Switch to using zsh before continuing" - echo "" - echo "MacOS Instructions:" - echo "System Preferences > Users & Groups > Unlock" - echo "Right-click on user, Advanced Options..." - echo "Login shell: /bin/zsh" - exit 1 - fi - - echo "zsh ✓" -} - -check_for_ohmyzsh() { - if [ ! -d ~/.oh-my-zsh ] - then - echo "oh-my-zsh ✕" - echo "" - echo "Install oh-my-zsh before continuing" - echo "You can run the script: install_ohmyzsh" - echo "" - exit 1 - fi - - echo "oh-my-zsh ✓" -} - install_xcode() { if [ "$(uname)" = "Darwin" ] then @@ -115,16 +86,6 @@ install_gitmux() { echo "gitmux ✓" } -install_spacemacs() { - emacsdir=~/.emacs.d - if ! (git -C "$emacsdir" pull > /dev/null 2>&1) - then - git clone -b develop https://github.com/syl20bnr/spacemacs "$emacsdir" - fi - - echo "spacemacs ✓" -} - setup_poetry() { poetry completions fish > $(brew --prefix)/share/fish/vendor_completions.d/poetry.fish } @@ -143,8 +104,6 @@ echo "" echo "consider running other scripts:" echo " - install_casks" echo " - configure_macos" -echo " - setup_keybase" echo " - install_python" echo " - install_rust" -echo " - install_cargos" echo "" diff --git a/scripts/backup_keybase b/scripts/saved/backup_keybase similarity index 100% rename from scripts/backup_keybase rename to scripts/saved/backup_keybase diff --git a/scripts/install_ohmyzsh b/scripts/saved/install_ohmyzsh similarity index 100% rename from scripts/install_ohmyzsh rename to scripts/saved/install_ohmyzsh diff --git a/scripts/setup_keybase b/scripts/saved/setup_keybase similarity index 100% rename from scripts/setup_keybase rename to scripts/saved/setup_keybase diff --git a/scripts/saved/unused_bootstraps b/scripts/saved/unused_bootstraps new file mode 100755 index 0000000..e2de625 --- /dev/null +++ b/scripts/saved/unused_bootstraps @@ -0,0 +1,40 @@ +#!/bin/sh + +check_for_zsh() { + if ! (echo "$SHELL" | grep zsh > /dev/null) + then + echo "Switch to using zsh before continuing" + echo "" + echo "MacOS Instructions:" + echo "System Preferences > Users & Groups > Unlock" + echo "Right-click on user, Advanced Options..." + echo "Login shell: /bin/zsh" + exit 1 + fi + + echo "zsh ✓" +} + +check_for_ohmyzsh() { + if [ ! -d ~/.oh-my-zsh ] + then + echo "oh-my-zsh ✕" + echo "" + echo "Install oh-my-zsh before continuing" + echo "You can run the script: install_ohmyzsh" + echo "" + exit 1 + fi + + echo "oh-my-zsh ✓" +} + +install_spacemacs() { + emacsdir=~/.emacs.d + if ! (git -C "$emacsdir" pull > /dev/null 2>&1) + then + git clone -b develop https://github.com/syl20bnr/spacemacs "$emacsdir" + fi + + echo "spacemacs ✓" +}