Bash-wrapper-functions: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:
* Getting the Java binary based on a combination of command line options, the content of the JAVA_HOME environment variable, and the "java" binary available in path.
* Getting the Java binary based on a combination of command line options, the content of the JAVA_HOME environment variable, and the "java" binary available in path.
* [[Nova_Ordis_Utilities_Version_Metadata_Handling#.22Light.22_Version_Reporting|"Light" version reporting functionality]], which relies on the presence of the lib/VERSION file.
* [[Nova_Ordis_Utilities_Version_Metadata_Handling#.22Light.22_Version_Reporting|"Light" version reporting functionality]], which relies on the presence of the lib/VERSION file.
 
* Command line argument pre-processing:
Command line argument handling:
** Single-quote enclosed arguments are not broken down but passed as such to the lower layer.
* Everything that is enclosed in double-quotes is passed as such to the java runtime as one argument, even if it includes spaces. <font color=red>The current implementation is faulty, multiple spaces are converted to just one space, fix. When fixing, start adding tests.</font>
* Escaped quotes are passed to the java runtime.


=GitHub=
=GitHub=

Revision as of 15:39, 28 October 2017

Internal

Overview

A project that offers common bash wrapper functionality in form of a single function file to be sourced in the main wrapper, and a main wrapper template ("application-shell-wrapper-template")

Functionality:

  • Basic error/warn/debug functionality.
  • Building a classpath based on the JAR content of a repository.
  • Getting the Java binary based on a combination of command line options, the content of the JAVA_HOME environment variable, and the "java" binary available in path.
  • "Light" version reporting functionality, which relies on the presence of the lib/VERSION file.
  • Command line argument pre-processing:
    • Single-quote enclosed arguments are not broken down but passed as such to the lower layer.

GitHub

https://github.com/NovaOrdis/bash-wrapper-functions

Usage

Copy bash-wrapper-functions in the bin directory and refer it as following:

 [ -f $(dirname $0)/bash-wrapper-functions ] && .  $(dirname $0)/bash-wrapper-functions || { echo "$(dirname $0)/bash-wrapper-functions not found" 1>&2; exit 1; }