dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

functions (513B)


      1 # .sh_functions
      2 
      3 # Sets xterm title to $1.
      4 tt() {
      5   echo -n "\033]0;$*\007"
      6 }
      7 
      8 use_flutter() {
      9   if (( $# == 0 )); then
     10     print -u2 "Usage: use_flutter <path_to_workspace>"
     11     return 1
     12   fi
     13   local LINK_PATH="$HOME/Developer/flutter/flutter"
     14   local TARGET_ABS="${1:A}"
     15   if [[ -h "$LINK_PATH" || -e "$LINK_PATH" ]]; then
     16     rm -f "$LINK_PATH"
     17   fi
     18   ln -s "$TARGET_ABS" "$LINK_PATH"
     19   # If we're currently under the symlink, reattach to the new inode.
     20   if [[ "$PWD" = "$LINK_PATH"* ]]; then
     21     cd .
     22   fi
     23 }