align variables
[scripts.git] / git / leap-fix.sh
1 #!/bin/bash
2
3 # example: 
4 # ./leap-fix.sh 3667
5 # Starting feature branch "3667_Sending_mail_fails_when_relaying_using_non-fully-qualified_hostname"
6 # ...
7
8 issue=$1
9
10 [ $issue -gt 0 ] || exit 1
11
12 # quick'n dirty
13 subject=`wget -q https://leap.se/code/issues/${issue}.json -O -| json_pp | grep '"subject"' | cut -d '"' -f 4 | sed "s/[][!@\'#\$\/%^&,\*() :]/_/g" |  cut -c -30`
14
15 [ $subject ] || exit 1
16
17 feature_default="${issue}_$subject"
18 #echo "Starting feature branch \"$feature\""
19 read -e -p "Enter feature branch name:" -i "$feature_default" feature
20
21 git flow feature start $feature