##// END OF EJS Templates
release script zsh compatibility
Matthias Bussonnier -
Show More
@@ -21,7 +21,7 b' WHITE=$(tput setaf 7)'
21 21 NOR=$(tput sgr0)
22 22
23 23
24 echo "Will use $EDITOR to edit files when necessary"
24 echo "Will use $BLUE'$EDITOR'$NOR to edit files when necessary"
25 25 echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: "
26 26 read input
27 27 PREV_RELEASE=${input:-$PREV_RELEASE}
@@ -37,11 +37,15 b' BRANCH=${input:-$BRANCH}'
37 37
38 38 ask_section(){
39 39 echo
40 echo $BLUE"$1"$NOR
40 echo $BLUE"$1"$NOR
41 41 echo -n $GREEN"Press Enter to continue, S to skip: "$NOR
42 read -n1 value
43 echo
44 if [ -z $value ] || [ $value = 'y' ] ; then
42 if [ "$ZSH_NAME" = "zsh" ] ; then
43 read -k1 value
44 value=${value%$'\n'}
45 else
46 read -n1 value
47 fi
48 if [ -z "$value" ] || [ $value = 'y' ]; then
45 49 return 0
46 50 fi
47 51 return 1
@@ -51,11 +55,17 b' ask_section(){'
51 55 maybe_edit(){
52 56 echo
53 57 echo $BLUE"$1"$NOR
54 echo -n $GREEN"Press e to Edit $1, any other keys to skip: "$NOR
55 read -n1 value
58 echo -n $GREEN"Press ${BLUE}e$GREEN to Edit ${BLUE}$1$GREEN, any other keys to skip: "$NOR
59 if [ "$ZSH_NAME" = "zsh" ] ; then
60 read -k1 value
61 value=${value%$'\n'}
62 else
63 read -n1 value
64 fi
65
56 66 echo
57 67 if [ $value = 'e' ] ; then
58 $EDITOR $1
68 $=EDITOR $1
59 69 fi
60 70 }
61 71
@@ -100,7 +110,7 b' then'
100 110 git checkout $PREV_RELEASE
101 111 echo $BLUE"Saving API to file $PREV_RELEASE"$NOR
102 112 frappuccino IPython --save IPython-$PREV_RELEASE.json
103 echo $BLUE"coming back to $BRANCH"$NOR
113 echo $BLUE"comming back to $BRANCH"$NOR
104 114 git checkout $BRANCH
105 115 echo $BLUE"comparing ..."$NOR
106 116 frappuccino IPython --compare IPython-$PREV_RELEASE.json
@@ -116,7 +126,7 b' echo $GREEN"please update version number in ${RED}IPython/core/release.py${NOR} '
116 126 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py${NOR}"
117 127 sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py
118 128 rm IPython/core/release.pybkp
119 git diff
129 git diff | cat
120 130 maybe_edit IPython/core/release.py
121 131
122 132 echo $GREEN"Press enter to continue"$NOR
@@ -163,7 +173,7 b' then'
163 173 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py${NOR}"
164 174 sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py
165 175 rm IPython/core/release.pybkp
166 git diff
176 git diff | cat
167 177 echo $GREEN"Please bump ${RED}the minor version number${NOR}"
168 178 maybe_edit IPython/core/release.py
169 179 echo ${BLUE}"Do not commit yet – we'll do it later."$NOR
General Comments 0
You need to be logged in to leave comments. Login now