diff --git a/doc b/doc index fd06e600a..791f99446 160000 --- a/doc +++ b/doc @@ -1 +1 @@ -Subproject commit fd06e600aedba7be2d962ca29182b9253f90a6a0 +Subproject commit 791f9944696928d6910f6bfcea8037fdd88f46ef diff --git a/scripts/src/main/resources/scripts/command/eclipse b/scripts/src/main/resources/scripts/command/eclipse index edd4f10da..501e988cb 100755 --- a/scripts/src/main/resources/scripts/command/eclipse +++ b/scripts/src/main/resources/scripts/command/eclipse @@ -29,7 +29,7 @@ function doSetup() { else #mirror="https://mirror.math.princeton.edu" local mirror="https://ftp.osuosl.org" - local software_version=`doGetVariable ECLIPSE_VERSION 2018-12` + local software_version="${ECLIPSE_VERSION:-2018-12}" local eclipse_edition=java local extract_folder= #eclipse_edition=jee @@ -112,7 +112,7 @@ function doConfigureEclipse() { function doStartEclipse() { doConfigureEclipse echo "launching Eclipse..." - eclipse -clean -data "${WORKSPACE_PATH}" -keyring "~/.eclipse/.keyring" -vm "${JAVA_HOME}/bin/java" -showlocation ${WORKSPACE} -vmargs ${ECLIPSE_VMARGS} & + eclipse -clean -data "${WORKSPACE_PATH}" -keyring ~/.eclipse/.keyring -vm "${JAVA_HOME}/bin/java" -showlocation ${WORKSPACE} -vmargs ${ECLIPSE_VMARGS} & } # CLI diff --git a/scripts/src/main/resources/scripts/command/ide b/scripts/src/main/resources/scripts/command/ide index 312fb6e0c..2d95f5fa7 100755 --- a/scripts/src/main/resources/scripts/command/ide +++ b/scripts/src/main/resources/scripts/command/ide @@ -6,6 +6,14 @@ DEVON_IDE_REPO_URL="https://repo.maven.apache.org/maven2/com/devonfw/tools/ide" function doUpdateScripts() { doUpgradeMavenArtifact "${DEVON_IDE_HOME}" "${DEVON_IDE_REPO_URL}" "devon-ide-settings" "${target_version}" ".tar.gz" "${devon_ide_version}" + if [ "${?}" = 0 ] + then + cp "${DEVON_IDE_HOME}/scripts/devon" ~/.devon/devon + if doIsWindows + then + cp "${DEVON_IDE_HOME}/scripts/devon.bat" "${USERPROFILE}/scripts/devon.bat" + fi + fi } function doUpdateSettings() { @@ -67,6 +75,31 @@ function doSetup() { done } +function doUninstall() { + echo "Uninstalling devon-ide..." + mkdir -p "${DEVON_IDE_HOME}/updates" + if [ -f ~/.bashrc ] + then + cat ~/.bashrc | grep -v '^alias devon="source ~/.devon/devon"$' | grep -v '^devon$' > "${DEVON_IDE_HOME}/updates/.bashrc" && mv "${DEVON_IDE_HOME}/updates/.bashrc" ~/.bashrc + fi + if [ -f ~/.zshrc ] + then + cat ~/.zshrc | grep -v '^alias devon="source ~/.devon/devon"$' | grep -v '^devon$' > "${DEVON_IDE_HOME}/updates/.zshrc" && mv "${DEVON_IDE_HOME}/updates/.zshrc" ~/.zshrc + fi + doRunCommand 'rm -rf ~/.devon' + if doIsWindows + then + if [ -d "${USERPROFILE}/.devon" ] + then + doRunCommand 'rm -rf "${USERPROFILE}/.devon"' + fi + if [ -f "${USERPROFILE}/scripts/devon" ] + then + doRunCommand 'rm "${USERPROFILE}/scripts/devon"' + fi + fi +} + target_version="LATEST" # CLI @@ -79,11 +112,15 @@ then echo "update check for updates and install if newer version is available" echo "update «package» [to «version»] update (or downgrade) specified package (to specified version)" echo " packages are e.g. 'scripts' or 'settings'" + echo "uninstall uninstall devon-ide and remove all OS hooks (revert devon ide setup)" exit elif [ "${1}" = "setup" ] then shift doSetup ${@} +elif [ "${1}" = "uninstall" ] +then + doUninstall elif [ "${1}" = "update" ] then if [ -z "${2}" ] diff --git a/scripts/src/main/resources/scripts/command/ng b/scripts/src/main/resources/scripts/command/ng index 403f62b31..6da1149f4 100755 --- a/scripts/src/main/resources/scripts/command/ng +++ b/scripts/src/main/resources/scripts/command/ng @@ -30,5 +30,6 @@ else fi if [ "${setup}" != "true" ] +then ng ${@} fi \ No newline at end of file diff --git a/scripts/src/main/resources/scripts/devon b/scripts/src/main/resources/scripts/devon index 54be808b6..ea3671346 100755 --- a/scripts/src/main/resources/scripts/devon +++ b/scripts/src/main/resources/scripts/devon @@ -75,8 +75,7 @@ then if ! grep -q "~/.devon/devon" ~/.bashrc then echo "Installing devon alias to your .bashrc" - echo "" >> ~/.bashrc - echo 'alias devon="source ~/.devon/devon"' >> ~/.bashrc + echo -e '\nalias devon="source ~/.devon/devon"\ndevon' >> ~/.bashrc fi if [ ! -e ~/.zshrc ] then @@ -85,8 +84,7 @@ then if ! grep -q "~/.devon/devon" ~/.zshrc then echo "Installing devon alias to your .zshrc" - echo "" >> ~/.zshrc - echo 'alias devon="source ~/.devon/devon"' >> ~/.zshrc + echo -e '\nalias devon="source ~/.devon/devon"\ndevon' >> ~/.zshrc fi alias devon="source ~/.devon/devon" echo "The devon CLI script has been installed to your system." diff --git a/scripts/src/main/resources/scripts/devon.bat b/scripts/src/main/resources/scripts/devon.bat index dcbd4c307..6396394c9 100644 --- a/scripts/src/main/resources/scripts/devon.bat +++ b/scripts/src/main/resources/scripts/devon.bat @@ -73,7 +73,11 @@ if not exist "%HOME%\.devon\devon" ( "%BASH%" -c 'source devon' popd ) -"%BASH%" -c 'source ~/.devon/devon %*' +if "%1%" == "bash" ( + "%BASH%" +) else ( + "%BASH%" -c 'source ~/.devon/devon %*' +) if not "%DEVON_PATH%" == "" ( set "DEVON_OLD_PATH=%PATH%" set "PATH=%DEVON_PATH%" diff --git a/scripts/src/main/resources/scripts/environment-project b/scripts/src/main/resources/scripts/environment-project index 050358215..839ccf2c2 100755 --- a/scripts/src/main/resources/scripts/environment-project +++ b/scripts/src/main/resources/scripts/environment-project @@ -30,8 +30,11 @@ function load_properties() { then unset ${key} else + if [ "${value:0:1}" != "(" ] + then + value=\"${value}\" + fi eval ${key}=${value} - #echo "${key}=${!key}" if [ "${export}" = "true" ] then export ${key} diff --git a/scripts/src/main/resources/scripts/environment-project.bat b/scripts/src/main/resources/scripts/environment-project.bat index 92f048d64..9cf9664b4 100644 --- a/scripts/src/main/resources/scripts/environment-project.bat +++ b/scripts/src/main/resources/scripts/environment-project.bat @@ -127,7 +127,6 @@ set "var=!var:export =! ( rem endlocal in () block to access local variable and "export" it endlocal - echo "%var%=%value%" rem use call in order to evaluate %var% inside value call set "%var%=%value%" ) diff --git a/scripts/src/main/resources/scripts/functions b/scripts/src/main/resources/scripts/functions index d39c85b44..1ceacd423 100755 --- a/scripts/src/main/resources/scripts/functions +++ b/scripts/src/main/resources/scripts/functions @@ -336,7 +336,7 @@ function doUpgradeMavenArtifact() { then echo "Found git repository ${1} - updating via git" doGitPullOrClone "${1}" - return + return ${?} fi local download_url="${2}" local artifact_id="${3}" @@ -359,7 +359,7 @@ function doUpgradeMavenArtifact() { if [ "${result}" = 0 ] then echo "The ${artifact_id} package is already at the latest version ${target_version}" - return + return 1 else echo "You are using version ${current_version} of ${artifact_id} " echo "The new version to install is ${target_version}" @@ -368,7 +368,7 @@ function doUpgradeMavenArtifact() { echo "You are using a newer version than the latest release version." echo "Hence there is nothing to update." echo "Seems as you are an active devonfw developer. Thanks for contributing!" - return + return 1 fi fi fi @@ -410,6 +410,7 @@ function doGitPullOrClone() { doRunCommand "git pull" "" "${1}" else echo "Can not update local git repository: ${1}" + return 1 fi else if [ -z "${2}" ] @@ -601,8 +602,11 @@ function doLoadProperties() { then unset ${key} else + if [ "${value:0:1}" != "(" ] + then + value=\"${value}\" + fi eval ${key}=${value} - #echo "${key}=${!key}" if [ "${export}" = "true" ] then export ${key} @@ -614,7 +618,9 @@ function doLoadProperties() { if [ -z "${DEVON_IDE_HOME}" ] then - DEVON_IDE_HOME="`dirname ${BASH_SOURCE:-$0}`/.." + cd "$(dirname ${BASH_SOURCE:-$0})/.." + DEVON_IDE_HOME="${PWD}" + cd - > /dev/null echo "DEVON_IDE_HOME variable set to ${DEVON_IDE_HOME}" fi doLoadProperties "${DEVON_IDE_HOME}/scripts/devon.properties"