Skip to content

Commit

Permalink
#914: Refactored and removed unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-cap committed Jan 16, 2025
1 parent 60cd034 commit 8b9b5a5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions cli/src/main/package/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@

function createFile() {
local fileName=$1
echo "File $fileName not found."
touch "$fileName"
echo "Created ${fileName}"
}

function checkIfFileExists() {
function createFileIfNotExists() {
local fileName=$1
if [ ! -f "${fileName#~/}" ]; then
if [ ! -f "${fileName}" ]; then
createFile "$fileName"
fi
}

function doSetupInConfigFile() {
local cfg=$1
checkIfFileExists "${cfg}"
if [ ! -f "${cfg}" ]; then
echo "${cfg} not found - skipping."
return
fi
createFileIfNotExists "${cfg}"
echo "Configuring IDEasy in ${cfg}."
if [ "${OSTYPE}" != "cygwin" ] && [ "${OSTYPE}" != "msys" ]; then
if ! grep -q "export IDE_ROOT=" "${cfg}"
Expand Down

0 comments on commit 8b9b5a5

Please sign in to comment.