#!/bin/bash # # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ # # Write a constant value to stdout. # # This will only ever write the constant value to stdout if it can successfully be read. # If the constant can be read, its value is printed with the .toString() method. # If an error occurs, nothing is written to stdout, and the error will be written to stderr. # If the value of the constant is null, nothing is printed to stdout, and "null" is printed to stderr. # # Usage: # # bconst classAndMember # # classAndMember : the full name of a Java class, followed by a dot and the constant member name # # For example: # # bconst bubble.ApiConstants.ROOT_NETWORK_UUID # SCRIPT="${0}" SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)" . "${SCRIPT_DIR}"/bubble_common CLASS_AND_MEMBER="${1:?sole param should be something like: bubble.pkg.SomeClass.SOME_CONSTANT}" shift BUBBLE_QUIET=1 exec ${SCRIPT_DIR}/bubble const "${CLASS_AND_MEMBER}" "${@}"