Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • better-git-prompt-integration
  • commit-signing
  • configuration-overrides
  • master
4 results

Target

Select target project
  • chris/dotfiles
1 result
Select Git revision
Show changes
Commits on Source (3)
......@@ -32,7 +32,7 @@ alias timezone='date +"%Z (GMT %:z)"'
alias week='date +%V'
# IP address
alias ip='dig +short myip.opendns.com @resolver1.opendns.com'
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
# Enable aliases to be sudo'ed
alias sudo='sudo '
......
......@@ -36,8 +36,11 @@ Options:
-f
This script will attempt to fix any issues it finds.
-t
Consider a title that don't match the recommended title as an issue.
-b <bts-prefix>
This allows you to specify a prefix to prepend to the names of "Behind the
This allows you to specify a prefix to prepend to the title of "Behind the
Scenes" files.
-d
......@@ -55,14 +58,18 @@ EOF
# Parse command options
flag_f=0
flag_t=0
flag_d=0
flag_p=0
bts_prefix=''
while getopts 'fb:dph' flag; do
while getopts 'ftb:dph' flag; do
case "${flag}" in
f)
flag_f=1
;;
t)
flag_t=1
;;
b)
bts_prefix="$OPTARG"
;;
......@@ -115,10 +122,13 @@ while IFS= read -rd '' file <&3; do
# Check title
title=$(echo "$file_info" | grep 'Title:' | sed 's/.* Title: \(.*\)$/\1/')
if [[ -z "$title" || $flag_t -eq 1 ]]; then
if [[ -z "$title" ]]; then
print_filename_once
echo "Title Missing"
if [[ $flag_f -eq 1 ]]; then
fi
# Generate a new title to recommend
new_title="$(basename "$file")" # get the filename
new_title="${new_title%.*}" # remove the extension
new_title="${new_title/% ([0-9][0-9][0-9][0-9])/}" # remove the year
......@@ -128,6 +138,18 @@ while IFS= read -rd '' file <&3; do
new_title="$bts_prefix$new_title"
fi
# If this is a TV episode, remove the show name and season/episode
# number
if [[ "$new_title" =~ S[0-9]+E[0-9]+ ]]; then
new_title="${new_title##*S[0-9][0-9]E[0-9][0-9] - }"
fi
if [[ $flag_t -eq 1 && "$title" != "$new_title" ]]; then
print_filename_once
echo "Title does not match recommended title [$new_title]"
fi
if [[ $flag_f -eq 1 ]]; then
echo -n "Enter a title, or s to skip [$new_title]: "
read -e user_title
new_title="${user_title:-$new_title}"
......