mirror of https://github.com/rwf2/Rocket.git
Various tiny improvements to shell scripts.
This commit is contained in:
parent
f0af77d917
commit
f397e49a99
|
@ -4,7 +4,7 @@
|
|||
# Bumps the version number from <current> to <next> on all libraries.
|
||||
#
|
||||
|
||||
if [ -z ${1} ] || [ -z ${2} ]; then
|
||||
if [ -z "${1}" ] || [ -z "${2}" ]; then
|
||||
echo "Usage: $0 <current> <next>"
|
||||
echo "Example: $0 0.1.1 0.1.2"
|
||||
exit 1
|
||||
|
|
|
@ -8,9 +8,9 @@ function relative() {
|
|||
if [ -d "${full_path}" ]; then
|
||||
# Try to use readlink as a fallback to readpath for cross-platform compat.
|
||||
if command -v realpath >/dev/null 2>&1; then
|
||||
echo $(realpath "${full_path}")
|
||||
realpath "${full_path}"
|
||||
elif ! (readlink -f 2>&1 | grep illegal > /dev/null); then
|
||||
echo $(readlink -f "${full_path}")
|
||||
readlink -f "${full_path}"
|
||||
else
|
||||
echo "Rocket's scripts require 'realpath' or 'readlink -f' support." >&2
|
||||
echo "Install realpath or GNU readlink via your package manager." >&2
|
||||
|
@ -31,10 +31,11 @@ CONTRIB_DIR=$(relative "contrib") || exit $?
|
|||
DOC_DIR=$(relative "target/doc") || exit $?
|
||||
|
||||
if [ "${1}" = "-p" ]; then
|
||||
echo $SCRIPT_DIR
|
||||
echo $EXAMPLES_DIR
|
||||
echo $LIB_DIR
|
||||
echo $CODEGEN_DIR
|
||||
echo $CONTRIB_DIR
|
||||
echo $DOC_DIR
|
||||
echo "${ROOT_DIR}"
|
||||
echo "${SCRIPT_DIR}"
|
||||
echo "${EXAMPLES_DIR}"
|
||||
echo "${LIB_DIR}"
|
||||
echo "${CODEGEN_DIR}"
|
||||
echo "${CONTRIB_DIR}"
|
||||
echo "${DOC_DIR}"
|
||||
fi
|
||||
|
|
|
@ -11,7 +11,6 @@ source "${SCRIPT_DIR}/config.sh"
|
|||
|
||||
function mk_doc() {
|
||||
local dir=$1
|
||||
local flag=$2
|
||||
pushd "${dir}" > /dev/null 2>&1
|
||||
echo ":: Documenting '${dir}'..."
|
||||
cargo doc --no-deps --all-features
|
||||
|
|
|
@ -31,7 +31,7 @@ function check_versions_match() {
|
|||
# Ensures there are no tabs in any file.
|
||||
function ensure_tab_free() {
|
||||
local tab=$(printf '\t')
|
||||
local matches=$(git grep -E -I "${tab}" "${ROOT_DIR}" | egrep -v 'LICENSE')
|
||||
local matches=$(git grep -E -I "${tab}" "${ROOT_DIR}" | grep -v 'LICENSE')
|
||||
if ! [ -z "${matches}" ]; then
|
||||
echo "Tab characters were found in the following:"
|
||||
echo "${matches}"
|
||||
|
|
Loading…
Reference in New Issue