diff --git a/aliases b/aliases index a5dd556..fc9109c 100644 --- a/aliases +++ b/aliases @@ -251,7 +251,6 @@ alias lca='lein cljsbuild auto dev' alias ldi='lein deps install' alias lsd='lein start-dev' alias moon='curl wttr.in/moon -A "curl"' -alias patch='git format-patch HEAD^ --stdout > patch.diff' alias reguard='killall -9 ruby ; guard' alias rb='rbenv' alias rbg='rbenv gemset active' @@ -367,6 +366,10 @@ dl_youtube_vid() { error "Format: $0 \n" return fi + if [[ $format == "" ]]; then + printf "${BOLD}No format given; using best available.${NORMAL}\n" + format="best" + fi opts+=" --write-sub --sub-lang en --embed-subs" @@ -386,11 +389,7 @@ dl_youtube_vid() { local filename=$(youtube-dl.exe --get-filename -o "$name_format.%(ext)s" $url) filename="${filename:0:4}-${filename:4:2}-${filename:6}" - if [[ $format == "" ]]; then - youtube-dl.exe -o "$filename" $opts $url - else - youtube-dl.exe -f $format -o "$filename" $opts $url - fi + youtube-dl.exe -f $format -o "$filename" $opts $url if [[ $make_folder == "1" ]]; then cd .. @@ -528,7 +527,11 @@ dl_twitch_vid() { if [[ $compress -eq 0 ]]; then printf "${BOLD}Downloading Twitch vid with no compression.${NORMAL}\n" else - printf "${BOLD}Downloading Twitch vid with compression.${NORMAL}.\n" + printf "${BOLD}Downloading Twitch vid with compression.${NORMAL}\n" + fi + if [[ $format == "" ]]; then + printf "${BOLD}No format given; using best available.${NORMAL}\n" + format="best" fi if [[ $make_folder == "1" ]]; then @@ -722,10 +725,10 @@ alias ig-download-and-hflip='dl_instagram_vid_and_hflip ' # Twitch Vid DL alias tw-src='dl_twitch_vid "Source" $SHORTNAME_OFF $COMPRESSION_OFF' -alias tw='dl_twitch_vid "1080p" $SHORTNAME_OFF $COMPRESSION_OFF' -alias tw-compressed='dl_twitch_vid "1080p" $SHORTNAME_OFF $COMPRESSION_ON' -alias tw-shortname='dl_twitch_vid "1080p" $SHORTNAME_ON $COMPRESSION_OFF' -alias tw-shortname-compressed='dl_twitch_vid "1080p" $SHORTNAME_ON $COMPRESSION_ON' +alias tw='dl_twitch_vid "" $SHORTNAME_OFF $COMPRESSION_OFF' +alias tw-compressed='dl_twitch_vid "" $SHORTNAME_OFF $COMPRESSION_ON' +alias tw-shortname='dl_twitch_vid "" $SHORTNAME_ON $COMPRESSION_OFF' +alias tw-shortname-compressed='dl_twitch_vid "" $SHORTNAME_ON $COMPRESSION_ON' alias tw-custom='dl_twitch_vid ' alias tw-chat='dl_twitch_chat' @@ -744,8 +747,8 @@ alias tw-1080p60-shortname-compressed='dl_twitch_vid "1080p60" $SHORTNAME_ON $CO alias tw-1080p50-shortname-compressed='dl_twitch_vid "1080p50" $SHORTNAME_ON $COMPRESSION_ON' alias tw-720='dl_twitch_vid "720p" $SHORTNAME_OFF $COMPRESSION_OFF' -alias tw-720-compressed='dl_twitch_vid "720p-1" $SHORTNAME_OFF $COMPRESSION_ON' -alias tw-720-shortname='dl_twitch_vid "720p-1" $SHORTNAME_ON $COMPRESSION_OFF' +alias tw-720-compressed='dl_twitch_vid "720p" $SHORTNAME_OFF $COMPRESSION_ON' +alias tw-720-shortname='dl_twitch_vid "720p" $SHORTNAME_ON $COMPRESSION_OFF' alias tw-720-60='dl_twitch_vid "720p60" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw-720-60-shortname='dl_twitch_vid "720p60" $SHORTNAME_ON $COMPRESSION_OFF' @@ -787,18 +790,18 @@ alias compress-video-hard='_compress_video_hard' #################################################################################################### if [[ '${platform,,}' == *'ming'* ]]; then - # Fix a weird mingw 'not a valid identifierline' error. - # Got the fix from https://github.com/Alexpux/MSYS2-packages/issues/735#issuecomment-328938800 - alias git="PATH=/usr/bin git" + # Fix a weird mingw 'not a valid identifierline' error. + # Got the fix from https://github.com/Alexpux/MSYS2-packages/issues/735#issuecomment-328938800 + alias git="PATH=/usr/bin git" fi git_cmd_wrapper() { - # If no args are provided then run `git status -s` - if [[ $# > 0 ]]; then - git $@ - else - git status -s - fi + # If no args are provided then run `git status -s` + if [[ $# > 0 ]]; then + git $@ + else + git status -s + fi } git_commit() { @@ -817,7 +820,14 @@ git_branch_name() { } git_nuke() { - git checkout master && git branch -D $1 && git push origin :$1 + git checkout master && git branch -D $1 && git push origin :$1 +} + +git_create_stash_patch() { + stashNum="$1" + file="stash_$stashNum.patch" + git stash show "stash@{$stashNum}" -p > $file + printf "${BOLD}${YELLOW}Created $file for stash@{$stashNum}.${NORMAL}\n" } alias am='git commit --amend' @@ -918,11 +928,11 @@ alias gsnapshot='git stash save "snapshot: $(date)" && git stash apply "stash@{0 alias gsh='git show' alias gshh='git show -w' alias gs='git stash' +alias gsc='git_create_stash_patch' alias gsk='git stash -k -u' alias gssk='git stash save -k -u' alias gss='git stash save' alias gsd='git stash drop' -alias gsdl='git stash drop stash@{0}' alias gsl='git stash list' alias gsi='git stash -p' alias gsp='git stash pop'