Make mycroft-core.sh invocable from outside

mycroft-core.sh has a relative-path call (that itself also likes to
be called from inside mycroft-core) that prevents making a clean start
of mycroft from outside the mycroft-core directory.  This makes doing
things like adding it as a Ubuntu Unity startup application slightly
messy.
pull/1049/head^2
Rhett Aultman 2017-10-10 14:29:28 -04:00 committed by Steve Penrod
parent 0bf3d9a668
commit 35c3af1e2c
3 changed files with 14 additions and 1 deletions

View File

@ -18,7 +18,16 @@ mycroft_root_dir='/opt/mycroft'
skills_dir="${mycroft_root_dir}"/skills
# exit on any error
set -Ee
chmod +x msm/msm
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
chmod +x ${DIR}/../msm/msm
# Determine which user is running this script
setup_user=$USER

View File

@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
SOURCE="${BASH_SOURCE[0]}"
script=${0}
script=${script##*/}
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

View File

@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
SOURCE="${BASH_SOURCE[0]}"
script=${0}
script=${script##*/}
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"