Skip to content

Commit

Permalink
devonfw#940: need to implement on mac, small improvements for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille committed Oct 17, 2022
1 parent ecd77c8 commit 4ecbbb9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions scripts/src/main/resources/scripts/functions
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function doRunCommand() {
local message
if [ -z "${2}" ]
then
message="run command ${1/ */}"
message="run command ${1}"
else
message="${2} (${1})"
fi
Expand Down Expand Up @@ -714,16 +714,6 @@ function doExtract() {
then
doSuccess "Successfully moved archive ${filename} to ${target_dir}"
else
local files=("${target_dir}"/*)
if [ "${#files[@]}" = 1 ]
then
local folder="${files[0]}"
if [ -d "${folder}" ] && [ "${folder}" != "bin" ] && [ "${folder}" != "Contents" ]
then
doDebug "Resolving single folder ${folder}"
doRunCommand "mv '${folder}'/{.,}*. '${target_dir}' && rmdir '${folder}'"
fi
fi
doSuccess "Successfully extracted archive ${filename} to ${target_dir}"
fi
}
Expand Down Expand Up @@ -827,6 +817,7 @@ function doReplaceExtractedSkipSingleFolder() {
shift 3
if [ "${#*}" = 1 ] && [ -d "${1}" ] && [[ ! "${1}" =~ .*\.app ]]
then
doDebug "Changing source directory from ${source_dir} to ${1} due to single folder."
source_dir="${1}"
fi
doReplaceExtractedFile "${source_dir}" "${target_dir}" "${backup_dir}"
Expand Down

0 comments on commit 4ecbbb9

Please sign in to comment.