Prevent unneeded mimic compilation in dev_setup.sh
The code that detected existing mimic installs and asked for confirmation before rebuilding had a few holes: * A source install of mimic under the mycroft-core tree was missed * Hitting "enter" or "spacebar" would be interpreted as "yes, rebuild", which didn't match the prompt.pull/851/merge
parent
8b1fb5de76
commit
ece734b55a
26
dev_setup.sh
26
dev_setup.sh
|
@ -44,19 +44,30 @@ else
|
||||||
VIRTUALENV_ROOT="$WORKON_HOME/mycroft"
|
VIRTUALENV_ROOT="$WORKON_HOME/mycroft"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# skip mimic build?
|
# Check whether to build mimic (it takes a really long time!)
|
||||||
|
build_mimic='y'
|
||||||
if [[ "$1" == '-sm' ]] ; then
|
if [[ "$1" == '-sm' ]] ; then
|
||||||
build_mimic='n'
|
build_mimic='n'
|
||||||
fi
|
else
|
||||||
|
# first, look for a build of mimic in the folder
|
||||||
|
has_mimic=""
|
||||||
|
if [[ -f ${TOP}/mimic/bin/mimic ]] ; then
|
||||||
|
has_mimic=$( ${TOP}/mimic/bin/mimic -lv | grep Voice )
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$1" != '-sm' ]] && hash mimic ; then
|
# in not, check the system path
|
||||||
if mimic -lv | grep -q Voice ; then
|
if [ "$has_mimic" = "" ] ; then
|
||||||
echo "Existing mimic installation. press y to build mimic again, any other key to skip."
|
if [ -x "$(command -v mimic)" ]; then
|
||||||
|
has_mimic="$( mimic -lv | grep Voice )"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [ "$has_mimic" == "" ] ; then
|
||||||
|
echo "Mimic is installed. Press 'y' to rebuild mimic, any other key to skip."
|
||||||
read -n1 build_mimic
|
read -n1 build_mimic
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# create virtualenv, consistent with virtualenv-wrapper conventions
|
# create virtualenv, consistent with virtualenv-wrapper conventions
|
||||||
if [ ! -d "${VIRTUALENV_ROOT}" ]; then
|
if [ ! -d "${VIRTUALENV_ROOT}" ]; then
|
||||||
mkdir -p $(dirname "${VIRTUALENV_ROOT}")
|
mkdir -p $(dirname "${VIRTUALENV_ROOT}")
|
||||||
|
@ -84,8 +95,7 @@ echo "Building with $CORES cores."
|
||||||
#build and install mimic
|
#build and install mimic
|
||||||
cd "${TOP}"
|
cd "${TOP}"
|
||||||
|
|
||||||
build_mimic="${build_mimic:-y}"
|
if [[ "$build_mimic" == 'y' ]] || [[ "$build_mimic" == 'Y' ]]; then
|
||||||
if [[ "$build_mimic" == 'y' ]] ; then
|
|
||||||
echo "WARNING: The following can take a long time to run!"
|
echo "WARNING: The following can take a long time to run!"
|
||||||
"${TOP}/scripts/install-mimic.sh"
|
"${TOP}/scripts/install-mimic.sh"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue