Skip to content

Instantly share code, notes, and snippets.

@sirhc
Created August 28, 2019 03:12
Show Gist options
  • Save sirhc/65d40f6a590891a61ef7d4b431a02770 to your computer and use it in GitHub Desktop.
Save sirhc/65d40f6a590891a61ef7d4b431a02770 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
IFS=$'\t\n'
PATH='/usr/bin:/usr/local/bin'
while read -r line; do
[[ $line =~ ^\s*$ ]] && continue
[[ $line =~ ^\s*# ]] && continue
dir="$(basename "$line")"
dir="${dir%.git}"
printf '[%s]\n' "$dir"
printf 'checkout = git clone '"'"'%s'"'"' '"'"'%s'"'"'\n' "$line" "$dir"
printf '\n'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment