--- bin/lein-pkg.orig 2024-01-31 19:01:13 UTC +++ bin/lein-pkg @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # This variant of the lein script is meant for downstream packagers. # It has all the cross-platform stuff stripped out as well as the @@ -6,39 +6,39 @@ export LEIN_VERSION="2.11.1" export LEIN_VERSION="2.11.1" -if [[ "$CLASSPATH" != "" ]]; then +if [ "$CLASSPATH" != "" ]; then cat <<-'EOS' 1>&2 WARNING: You have $CLASSPATH set, probably by accident. It is strongly recommended to unset this before proceeding. EOS fi -if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then +if [ "$OSTYPE" == "cygwin" ] || [ "$OSTYPE" == "msys" ]; then delimiter=";" else delimiter=":" fi -if [[ "$OSTYPE" == "cygwin" ]]; then +if [ "$OSTYPE" == "cygwin" ]; then cygwin=true else cygwin=false fi -function msg { +msg() { echo "$@" 1>&2 } -function command_not_found { +command_not_found() { msg "Leiningen couldn't find $1 in your \$PATH ($PATH), which is required." exit 1 } -function make_native_path { +make_native_path() { # ensure we have native paths - if $cygwin && [[ "$1" == /* ]]; then + if $cygwin && [ "$1" == /* ]; then echo -n "$(cygpath -wp "$1")" - elif [[ "$OSTYPE" == "msys" && "$1" == /?/* ]]; then + elif [ "$OSTYPE" == "msys" ] && [ "$1" == /?/* ]; then echo -n "$(sh -c "(cd $1 2/dev/null 2>&1; then + if type sha256sum >/dev/null 2>&1; then export SHASUM_CMD="sha256sum" - elif type -p shasum >/dev/null 2>&1; then + elif type shasum >/dev/null 2>&1; then export SHASUM_CMD="shasum --algorithm 256" - elif type -p sha256 >/dev/null 2>&1; then + elif type sha256 >/dev/null 2>&1; then export SHASUM_CMD="sha256 -q" else command_not_found sha256sum @@ -221,7 +221,7 @@ run_from_checkout "$1" run_from_checkout "$1" -if [ ! -x "$JAVA_CMD" ] && ! type -f java >/dev/null +if [ ! -x "$JAVA_CMD" ] && ! type java >/dev/null then msg "Leiningen couldn't find 'java' executable, which is required." msg "Please either set JAVA_CMD or put java (>=1.6) in your \$PATH ($PATH)." @@ -230,7 +230,7 @@ export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-${JAVA_CMD:-jav export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-${JAVA_CMD:-java}}" -if [[ -z "${DRIP_INIT+x}" && "$(basename "$LEIN_JAVA_CMD")" == *drip* ]]; then +if [ -z "${DRIP_INIT+x}" ] && [ "$(basename "$LEIN_JAVA_CMD")" == *drip* ]; then export DRIP_INIT="$(printf -- '-e\n(require (quote leiningen.repl))')" export DRIP_INIT_CLASS="clojure.main" fi