diff --git a/install.sh b/install.sh index 25d209da..ee60748b 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,10 @@ cp MainIcon.png /usr/share/icons/universal-editor.png cp net.alcetech.UniversalEditor.desktop /usr/share/applications -mkdir /usr/lib/universal-editor +if [ ! -d /usr/lib/universal-editor ]; then + mkdir /usr/lib/universal-editor +fi + cp -r Output/Debug/* /usr/lib/universal-editor cp universal-editor /usr/lib/universal-editor @@ -11,7 +14,7 @@ cp universal-editor /usr/lib/universal-editor echo "#!/bin/sh cd /usr/lib/universal-editor -./universal-editor ${1+\"$@\"} +./universal-editor \${1+\"\$@\"} " > /usr/bin/universal-editor chmod a+x /usr/bin/universal-editor diff --git a/universal-editor b/universal-editor index 364d6243..8be4216d 100755 --- a/universal-editor +++ b/universal-editor @@ -2,5 +2,15 @@ FLAVOR=Debug APPNAME=UniversalEditor -cd Output/$FLAVOR -mono $APPNAME.exe ${1+"$@"} +if [ -d Output/$FLAVOR ]; then + + # running from git repository + cd Output/$FLAVOR + mono $APPNAME.exe ${1+"$@"} + +else + + # installed to local machine + mono $APPNAME.exe ${1+"$@"} + +fi