Skip to content

Commit

Permalink
Merge branch 'master' into feature/devonfw#1039-Add-support-for-Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille authored Apr 13, 2023
2 parents ce3e0dc + 7a3dcf7 commit f4389dd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This file documents all notable changes to https://github.com/devonfw/ide[devonf

Release with new features and bugfixes:

* https://github.com/devonfw/ide/issues/1076[#1076]: Fix extraction error in doReplaceExtractedSkipSingleFolder()
* https://github.com/devonfw/ide/issues/1054[#1054]: automated security warnings
* https://github.com/devonfw/ide/issues/1039[#1039]: Add support for Kotlin.

Expand Down
3 changes: 1 addition & 2 deletions scripts/src/main/resources/scripts/command/release
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ then
echo "... optional arguments are directly passed to the build command (e.g. mvn) as additional arguments."
exit
fi

doDevonCommand mvn setup silent
if doGitHasUncomittedChanges
then
doFail "Your local git repository has uncommitted changes. Please use 'git stash' and rerun on clean repo."
Expand All @@ -48,7 +48,6 @@ then
doFail "Release has to be performed from the top-level project or using force option."
fi
fi

doEcho "Trying to determine current version of your project..."
current_version="$(doDevonCommand build -q get-version)" || doFail "Failed to determine version. You need to run 'mvn install' before.\n${current_version}"
if doIsDevVersion "${current_version}"
Expand Down
36 changes: 11 additions & 25 deletions scripts/src/main/resources/scripts/functions
Original file line number Diff line number Diff line change
Expand Up @@ -898,34 +898,20 @@ function doBackup() {
# $3: backup path
# $4-$N: contents of $1 ($1/* so all files in the folder of $1 after globbing)
function doReplaceExtractedSkipSingleFolder() {
local source_dir="${1}"
local target_dir="${2}"
local backup_dir="${3}"
local root_dir="${1}"
local source_path="${1}"
local target_path="${2}"
local backup_path="${3}"
shift 3
local files
local anz_files
local dir="${1}"
if [ "${#*}" = 1 ] && [ "${1%.app}" = "${1}" ] && [ -d "${1}" ]
local basename="${source_path/*\//}"
if [ "${#*}" = 1 ] && [ "${source_path%.app}" = "${source_path}" ] && [ -d "${source_path}" ] && [ "${basename}" != "Contents" ] && [ "${basename}" != "bin" ]
then
files="$(find "${dir}" -maxdepth 1 -mindepth 1 -exec basename {} \;)"
anz_files="$(echo "${files}" | awk 'END{print NR}')"
while [ "${anz_files}" == "1" ]
do
if [ -d "${dir}/${files}" ] && [ "${files}" != "bin" ] && [ "${files%.app}" = "${files}" ]
then
dir="${dir}/${files}"
else
break
fi
files="$(find "${dir}" -maxdepth 1 -mindepth 1 -exec basename {} \;)"
anz_files="$(echo "${files}" | awk 'END{print NR}')"
done
source_dir="${dir}"
doDebug "Changing source directory from ${root_dir} to ${source_dir} due to single folder."
doDebug "Changing source directory from ${source_path} to ${1} due to single folder."
source_path="${1}"
doReplaceExtractedSkipSingleFolder "${source_path}" "${target_path}" "${backup_path}" "${source_path}"/*
else
doReplaceExtractedFile "${source_path}" "${target_path}" "${backup_path}"
[ -d "${source_path}" ] && rm -rf "${source_path}"
fi
doReplaceExtractedFile "${source_dir}" "${target_dir}" "${backup_dir}"
[ -d "${root_dir}" ] && rm -rf "${root_dir}"
}

# $1: path of the extracted name to install (move to target)
Expand Down

0 comments on commit f4389dd

Please sign in to comment.