Fix install from within Mycroft on Mark1/Picroft
MSM was invoking 'sudo chown' every time it installs new skills.
However the skill folder is already under the correct user when it
has been installed this way, so the chown is unnecessary.  Now we
check for the user and group before performing the action.
@@ -254,11 +254,16 @@ function install() {
return 102
fi
if [[ "${picroft_mk1}" == "true" ]] ; then
+ # Verify skill folder is accessible to the 'mycroft' user
+ owner=$( stat -c %U "${mycroft_skill_folder}/${name}" )
+ group=$( stat -c %G "${mycroft_skill_folder}/${name}" )
+ if [[ "${group}" != "mycroft" ]] || [[ "${owner}" != "mycroft" ]] ; then
if ! sudo chown -R mycroft:mycroft "${mycroft_skill_folder}/${name}" ; then
echo "ERROR: Unable to chown install directory ${name}!"
return 123
fi
fi
+ fi
if [[ -f "requirements.txt" ]]; then
echo " Installing requirements..."
if [[ "${picroft_mk1}" == "false" ]]; then
