this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update yadm bootstrap scripts and fish functions

+54 -36
+3
.config/fish/.gitignore
··· 1 1 # Files managed by `fisher` 2 2 fisher_install/ 3 + 4 + # Symlink from yadm alt 5 + conf.d/20-iterm2_shell_integration.fish
+5
.config/fish/completions/git.fish
··· 10 10 complete -x -c git -n '__fish_git_using_command commit' \ 11 11 -l no-verify -s n -d 'Bypass the pre-commit and commit-msg hooks' 12 12 end 13 + 14 + if functions -q __fish_git_using_command 15 + # Add completion for --no-verify 16 + complete -c git -n '__fish_git_using_command ls ld' --wraps 'git log' 17 + end
+9
.config/fish/functions/configure_folly.fish
··· 1 + function configure_folly 2 + pushd ~/Documents/workspace/thirdparty/folly/folly 3 + autoreconf -ivf 4 + ./configure \ 5 + CPPFLAGS="-I/opt/local/include -I/usr/local/opt/boost@1.55/include" \ 6 + LDFLAGS="-L/opt/local/lib -L/usr/local/opt/boost@1.55/lib" \ 7 + --with-boost=/usr/local/opt/boost@1.55 8 + popd 9 + end
-5
.config/fish/functions/dsh.fish
··· 1 1 function dsh 2 - if test (uname) = "Darwin" 3 - echo "dsh not supported on macOS!" 4 - return 1 5 - end 6 - 7 2 pushd ~/Documents/workspace 8 3 9 4 set -l dlib "tools/dlib.sh"
+6 -4
.config/fish/functions/sync_file.fish
··· 21 21 end 22 22 23 23 if test -f $argv[1] 24 - echo "Copying '$argv[1]' to remote '$argv[2]'" 25 - set -a scp_args "$argv[1]" "$argv[2]:"(pwd)"/$argv[1]" 24 + set -l dest (dirname "$argv[1]") 25 + echo "Copying '$argv[1]' to '$argv[2]:$dest'" 26 + set -a scp_args "$argv[1]" "$argv[2]:"(pwd)"/$dest" 26 27 else 27 - echo "Copying file '$argv[2]' from remote '$argv[1]'" 28 - set -a scp_args "$argv[1]:"(pwd)"/$argv[2]" "$argv[2]" 28 + set -l dest (dirname "$argv[2]") 29 + echo "Copying from '$argv[1]:$argv[2]' to $dest" 30 + set -a scp_args "$argv[1]:"(pwd)"/$argv[2]" (dirname "$argv[2]") 29 31 end 30 32 31 33 scp $scp_args
+8 -14
.config/fish/i95_cmake_targets.fish
··· 15 15 set -l build_dir (gbase)"/build" 16 16 17 17 vssh "if test -d $build_dir; cd $build_dir && cat i95_cmake_targets.txt; end" | egrep "$search_regex" 18 - 19 - # Ripgrep for dumb heuristic: 20 - # rg $rg_opts --glob 'CMakeLists.txt' --replace '$target' -- $search_regex'.*$' (gbase) \ 21 - # | string trim -- \ 22 - # | string replace '${PROJECT_NAME}' '128T' -- \ 23 - # | egrep -v '\$|#.*' # exclude things with unexpanded variables or commented out 24 18 end 25 19 26 - function __complete_build_opts 27 - set cmd $argv[1] 28 - 20 + function __get_build_opts 29 21 set build_script (gbase)/tools/env_scripts/build 30 22 if ! test -x $build_script 31 23 return 32 24 end 33 25 34 - set build_opts ( 35 - $build_script -h \ 26 + $build_script -h \ 36 27 | rg $rg_opts --replace '$1' -- '-(\S+)\s+[-].*$' - \ 37 28 | grep -v '\[|\]' \ 38 29 | string replace '/' "\n" -- \ 39 30 | string trim -- 40 - ) 31 + end 32 + 33 + function __complete_build_opts 34 + set cmd $argv[1] 41 35 42 - for build_opt in $build_opts 36 + for build_opt in (__get_build_opts) 43 37 if string match --quiet "*=*" -- $build_opt 44 38 set split_opt (string split "=" $build_opt) 45 39 __complete_cmd $cmd --old-option $split_opt[1] -x ··· 48 42 __complete_cmd $cmd --old-option $positive_opt 49 43 __complete_cmd $cmd --old-option "no$positive_opt" 50 44 else 51 - __complete_cmd $cmd --old-option $build_opt 45 + __complete_cmd $cmd --old-option "$build_opt" 52 46 end 53 47 end 54 48 end
+15 -9
.config/yadm/hooks/pre_commit
··· 11 11 exit 0 12 12 fi 13 13 14 - # shellcheck source=utils.sh 14 + # shellcheck source=../utils.sh 15 15 source utils.sh 16 16 17 17 if command -v shellcheck >/dev/null; then ··· 21 21 hooks/* 22 22 ) 23 23 24 - if ! shellcheck "${SHELLCHECK_SOURCES[@]}"; then 25 - echo "Some files failed the shellcheck linter!" 26 - exit 1 24 + if ! shellcheck --source-path=SCRIPTDIR "${SHELLCHECK_SOURCES[@]}"; then 25 + exit_with_error "Some files failed the shellcheck linter!" 27 26 fi 28 27 fi 29 28 30 29 if command -v code >/dev/null; then 31 30 if ! check_vscode_exts &>/dev/null; then 32 - list_vscode_exts >$VSCODE_EXTENSIONS 33 - echo "$VSCODE_EXTENSIONS was out-of-date." 34 - echo "It has been auto-updated, and should be committed." 35 - exit 1 31 + list_vscode_exts >"$VSCODE_EXTENSIONS" 32 + exit_with_error \ 33 + "$VSCODE_EXTENSIONS was out-of-date." \ 34 + "It has been auto-updated, and should be committed." 36 35 fi 37 36 fi 38 37 39 - # TODO: convert other scripts to fish instead of bash (except bootstrap) 38 + # Check for unstaged fish changes (typically new functions/completions) 39 + untracked_fish_files=$(yadm ls-files --full-name --exclude-standard --others -- ~/.config/fish) 40 + if [[ $untracked_fish_files ]]; then 41 + exit_with_error "Untracked files found in ~/.config/fish:" "$untracked_fish_files" 42 + fi 43 + 40 44 fish -c fish_normalize_saved_functions 45 + 46 + # TODO: convert other scripts to fish instead of bash (except bootstrap)
+8 -4
.config/yadm/utils.sh
··· 33 33 "$@" 34 34 } 35 35 36 + function exit_with_error() { 37 + printf "ERROR: " 38 + printf '%s\n' "$@" 39 + echo 40 + exit 1 41 + } 42 + 36 43 function install_vscode_exts() { 37 44 xargs printf -- "--install-extension %s " <"$VSCODE_EXTENSIONS" | xargs code 38 45 echo ··· 48 55 ) 49 56 50 57 if [[ -n $UNINSTALLED ]]; then 51 - echo "ERROR: some VSCode extensions were not installed:" 52 - echo "$UNINSTALLED" 53 - echo 54 - return 1 58 + exit_with_error "Some VSCode extensions were not installed:" "$UNINSTALLED" 55 59 fi 56 60 57 61 local INSTALLED