From dcbbb389acad3e2898ce86ebe59e6d56bd9f273a Mon Sep 17 00:00:00 2001 From: Jonathan Bowen Date: Sun, 27 Dec 2020 13:07:52 -0500 Subject: [PATCH] Fix bug where missing BIN_PATH or APP_PATH causes install to fail. --- installer.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/installer.sh b/installer.sh index e692b3d..5d2b79e 100755 --- a/installer.sh +++ b/installer.sh @@ -283,6 +283,12 @@ if [ "${INSTALL_TYPE}" = 'User' ]; then BIN_PATH="${HOME}/.local/bin" APP_PATH="${HOME}/.local/share/applications" SYS_PATH="${HOME}/.local/share/winapps" + if [ ! -d "${BIN_PATH}" ]; then + mkdir "${BIN_PATH}" + fi + if [ ! -d "${APP_PATH}" ]; then + mkdir "${APP_PATH}" + fi if [ -n "${2}" ]; then if [ "${2}" = '--uninstall' ]; then # Uninstall @@ -299,6 +305,12 @@ elif [ "${INSTALL_TYPE}" = 'System' ]; then BIN_PATH="/usr/local/bin" APP_PATH="/usr/share/applications" SYS_PATH="/usr/local/share/winapps" + if [ ! -d "${BIN_PATH}" ]; then + mkdir "${BIN_PATH}" + fi + if [ ! -d "${APP_PATH}" ]; then + mkdir "${APP_PATH}" + fi if [ -n "${2}" ]; then if [ "${2}" = '--uninstall' ]; then # Uninstall