Skip to content

Commit

Permalink
#751 Documentation of functions
Browse files Browse the repository at this point in the history
#751 Documentation of functions
  • Loading branch information
CREITZ25 committed Jun 14, 2022
1 parent fd40b2a commit 1ad3fa5
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions documentation/functions.asciidoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
= Beschreibung der 52 Funktionen

:toc:
toc::[]

= doFail
The doFail function is called with an error message as the first parameter and an exit code as the second parameter. The function first calls the doEchoAttention function without parameter, followed by the specified error message and a message on how to proceed. If a 0 is specified as the exit code, the function ends with exit code 1, otherwise with the specified exit code. If no exit code is specified, the function terminates with exit code 255.

= doEchoAttention
The doEchoAttention function returns the header ******** ATTENTION ******** followed by the message specified as a parameter. Backslash-escaped characters, for example \n for new line, are also allowed in the message.
The doEchoAttention function returns the header ******** ATTENTION ******** followed by the message specified as a parameter. Backslash-escaped characters, for example "\n" for new line, are also allowed in the message.

= doResult
The function doResult outputs the message passed as the first parameter, depending on the second parameter as Succeeded for 0 or Failed for all other values. If the second parameter is not specified, Failed (internal error missing exit code) is output.
Expand All @@ -31,16 +29,34 @@ The doIsQuiet function returns a 0 if the quiet variable is set.
The function returns 0 if the debug variable is set and the -q option is not specified.

= doIsIgnoredFolder
The function doIsIgnoredFolder checks whether the directory that is passed to it as a parameter corresponds to the directory target, eclipse-target, node_modules, .git, or .svn and returns the return code 0 otherwise 255.

= doEcho
The doEcho function prints the arguments passed to it if the variable quiet is not set. Backslash-escaped characters, for example \n for new line, are also allowed in the message.
The doEcho function prints the arguments passed to it if the variable quiet is not set. Backslash-escaped characters, for example "\n" for new line, are also allowed in the message.

= doInfo
The doInfo function prints the message passed as a parameter in blue and appends an extra blank line, and allows backslash-escaped characters, for example \n for new line.

= doEchoStep
The doEchoStep function prints the message passed as a parameter with three asterisks before and after the message in purple, and allows backslash-escaped characters, for example "\n" for new line.

= doEchoOption
The doEchoOption function outputs the message passed as a parameter in light blue, and allows backslash-escaped characters, e.g. "\n" for new line.

= doEchoInteraction
The doEchoInteraction function outputs the message passed as a parameter in light blue and appends a blank line, and allows backslash-escaped characters, for example "\n" for new line.

= doDebug
The doDebug function is called with arguments that are printed if the variable debug is set. Backslash-escaped characters, for example \n for new line, are also allowed in the arguments.
The doDebug function is called with arguments that are printed if the variable debug is set. Backslash-escaped characters, for example "\n" for new line, are also allowed in the arguments.

= doWarning
The doWarning function outputs the text WARNING: with the message passed in the parameter and allows backslash-escaped characters, for example "\n" for new line.

= doConfirmWarning
The doConfirmWarning function calls the doWarning function with the message passed to it, and then calls the doAskToContinue function with no parameters.

= doAskToContinue

= doLogo
The doLogo function returns the devon logo.

Expand All @@ -65,10 +81,18 @@ The doExtract function is given the file to be extracted and possibly a path to
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.

= doIsInstallerExtension
The doIsInstallerExtension function checks whether the file extension of the file specified in the parameter is an executable file, i.e. .exe .msi .pkg or .bat. If so, the function returns 0, otherwise 255.

= doReplaceExtractedFile
The doReplaceExtractedFile function is called with the three parameters path of the file or directory to be moved, the target directory and a backup directory. The function creates missing directories, makes a backup from the target directory to the backup directory. Then the files specified in the first parameter are moved to the target directory.

= doBackup
A file or directory is transferred to the doBackup function as the first parameter and the date after which the backup directory is named that is to be created in the /updates/backups subdirectory for the backup as the second parameter. If the second parameter is not specified, the current date is used. If a single file is specified in the first parameter and such a file already exists in the backup directory, then a time stamp is added to the backup directory as an additional subdirectory. Then the backup directory is created and the files to be backed up are moved there.

= doReplaceExtractedSkipSingleFolder
= doReplaceExtracted
The doReplaceExtracted function prepares to move an unpacked archive (specified in the first parameter). The current date is defined as the name for the backup directory of the currently installed software. Then it is checked whether the target directory (specified in the second parameter) corresponds to DEVON_IDE_HOME. If it does not correspond to DEVON_IDE_HOME, the function doReplaceExtractedSkipSingleFolder is called and the parameters archive directory, target directory, backup directory and the specification that all files in the archive directory are to be processed are passed. If the target directory is DEVON_IDE_HOME, which corresponds to the complete devonfw IDE installation, then all files and directories, except the workspaces directory, are passed in a loop to the doReplaceExtractedFile function as the first parameter, the second parameter specifies the target directory with the corresponding subdirectory names and the third Parameter is the backup directory. Attention: for one installation package the function doReplaceExtractedSkipSingleFolder is called, while in the other case the function doReplaceExtractedFile is called in a loop.

= doMavenGetLatestVersion
= doIsDevVersion
= doArrayContainsItemWithPrefix
Expand Down

0 comments on commit 1ad3fa5

Please sign in to comment.