Commit 9df3134e authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Use 'pip uninstall', to handle the failure of --upgrade

parent be2f848e
......@@ -2,7 +2,26 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. ${DIR}/
# Setup the tools in ~/.local/bin
cd $DIR/../msc-editor || exit 1
# Skip install if the version installed is the same and the tree is clean
HEAD="$(grep __version msce/ | head -1 | awk -F\' '{print $(NF-1)}')"
# This is much slower than a --version option would be...
# But there's no such functionality in msc-editor :-(
VERSION_INSTALLED="$(pip2 freeze | grep msce | awk -F= '{print $NF}')"
git status >/dev/null
if [ ${TREE_CLEAN} -eq 0 -a "${HEAD}" == "${VERSION_INSTALLED}" ] ; then
echo MSC editor tree is clean and already installed. Skipping MSCE install...
exit 0
# Unfortunately, the --upgrade DOES NOT ALWAYS WORK.
# Uninstall first...
echo y | pip2 uninstall msce
pip2 install --user --upgrade . || exit 1
# Add .local/bin to PATH
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment