diff --git a/documentation/functions.asciidoc b/documentation/functions.asciidoc index 8f462e967..e9914bc5b 100644 --- a/documentation/functions.asciidoc +++ b/documentation/functions.asciidoc @@ -160,6 +160,9 @@ The doIsInstallerExtension function checks whether the file extension of the fil === doIsPackageJsonContainingScript The function doIsPackageJsonContainingScript checks whether the module passed with the first parameter is contained in the package package.json. If so, then it ends with the return value 0 otherwise with a message and the return value 255. +=== doListSoftwareVersions +The function doListSoftwareVersions takes the name of the tool as a parameter and displays the available versions. + === doMoveGlobSafe The doMoveGlobSafe function moves the file specified as the second parameter after checking whether it exists to the target specified in parameter one and outputs the performed action via doEcho. @@ -190,6 +193,9 @@ The doRunCommand function can be given 3 parameters, the command to be executed, === doRunConfigurator The doRunConfigurator function transfers all jar files in the DEVON_IDE_HOME/scripts/lib directory separated by ":" as a class path to the Java command and executes the Java program specified as a parameter. +=== doSetSoftwareVersion +The function doSetSoftwareVersion is used to set a specific version of a software tool, and requires 2 parameters: the name of the software tool and the desired version. The version is saved as `«tool»_VERSION` variable in `settings/devon.properties`. + === doUnzip The doUnzip function checks if an unzip program is installed, and if not, installs the program. The file specified in the first parameter is then unpacked into the directory specified in the second parameter. diff --git a/scripts/src/main/resources/scripts/functions b/scripts/src/main/resources/scripts/functions index 841e87843..139d3e9e6 100755 --- a/scripts/src/main/resources/scripts/functions +++ b/scripts/src/main/resources/scripts/functions @@ -1562,9 +1562,10 @@ function doSetSoftwareVersion() { then version="$(head -n 1 ${DEVON_IDE_HOME}/mirrors/${software}/available-versions)" fi - grep -v "${software^^}_VERSION" ${DEVON_IDE_HOME}/settings/devon.properties > ${DEVON_IDE_HOME}/settings/devon.properties.tmp + software=$(echo "${software}" | awk '{print toupper($0)}') + grep -v "${software}_VERSION" ${DEVON_IDE_HOME}/settings/devon.properties > ${DEVON_IDE_HOME}/settings/devon.properties.tmp mv ${DEVON_IDE_HOME}/settings/devon.properties.tmp ${DEVON_IDE_HOME}/settings/devon.properties - echo "${software^^}_VERSION=\"${version}\"" >> ${DEVON_IDE_HOME}/settings/devon.properties + echo "${software}_VERSION=\"${version}\"" >> ${DEVON_IDE_HOME}/settings/devon.properties else doError "You have to specify the version you want to set." fi