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