From 771b8aa36b89882e485d1fefe521a9c0e2c24b02 Mon Sep 17 00:00:00 2001 From: Kris Gesling Date: Wed, 26 May 2021 19:10:42 +0930 Subject: [PATCH] Improve writing of config under different conditions --- dev_setup.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dev_setup.sh b/dev_setup.sh index 92ee65ae6f..b9ba0ed4d6 100755 --- a/dev_setup.sh +++ b/dev_setup.sh @@ -185,16 +185,18 @@ in mycroft.conf. N)o, stop the installation." if get_YN ; then if [[ ! -f /etc/mycroft/mycroft.conf ]]; then - if [[ ! -e /etc/mycroft/ ]]; then - $SUDO mkdir /etc/mycroft - fi - $SUDO cp $TOP/mycroft/configuration/mycroft.conf /etc/mycroft/ + $SUDO mkdir -p /etc/mycroft + $SUDO touch /etc/mycroft/mycroft.conf + $SUDO bash -c 'echo "{ \"use_precise\": true }" > /etc/mycroft/mycroft.conf' + else + $SUDO bash -c 'jq ". + { \"use_precise\": true }" /etc/mycroft/mycroft.conf > tmp.mycroft.conf' + $SUDO mv -f tmp.mycroft.conf /etc/mycroft/mycroft.conf fi - $SUDO sed -i "s/\"use_precise\": true/\"use_precise\": false/" /etc/mycroft/mycroft.conf else echo -e "$HIGHLIGHT N - quit the installation $RESET" exit 1 fi + echo fi echo " Do you want to run on 'master' or against a dev branch? Unless you are