Distribute and run LLMs with a single file.
C++ cross-platformggufllama-cpplocal-ailocal-inferencelocal-llmopen-source-aisingle-file-executablespeech-to-text
Fix download-cosmocc.sh on Mac (#177)
Jōshin8d5e91ff5290
diff --git a/build/download-cosmocc.sh b/build/download-cosmocc.shindex f054622f..13310a4e 100755--- a/build/download-cosmocc.sh+++ b/build/download-cosmocc.sh@@ -29,7 +29,14 @@ if ! UNZIP=$(command -v unzip 2>/dev/null); thenprintf '%s\n' "please download https://cosmo.zip/pub/cosmos/bin/unzip and put it on the system path" >&2abortfi-if ! SHA256SUM=$(command -v sha256sum 2>/dev/null); then+if command -v sha256sum >/dev/null 2>&1; then+ # can use system sha256sum+ true+elif command -v shasum >/dev/null 2>&1; then+ sha256sum() {+ shasum -a 256 "$@"+ }+elseif [ ! -f build/sha256sum.c ]; thenprintf '%s\n' "$0: fatal error: you need to install sha256sum" >&2printf '%s\n' "please download https://cosmo.zip/pub/cosmos/bin/sha256sum and put it on the system path" >&2@@ -51,6 +58,9 @@ if ! SHA256SUM=$(command -v sha256sum 2>/dev/null); then"${CC}" -w -O2 -o "${SHA256SUM}.$$" build/sha256sum.c || abortmv -f "${SHA256SUM}.$$" "${SHA256SUM}" || abortfi+ sha256sum() {+ "${SHA256SUM}" "$@"+ }fiif WGET=$(command -v wget 2>/dev/null); thenDOWNLOAD=$WGET@@ -82,7 +92,7 @@ if ! "${DOWNLOAD}" ${DOWNLOAD_ARGS} cosmocc.zip "${URL1}"; then"${DOWNLOAD}" ${DOWNLOAD_ARGS} cosmocc.zip "${URL2}" || diefiprintf '%s\n' "${COSMOCC_SHA256SUM} *cosmocc.zip" >cosmocc.zip.sha256sum-"${SHA256SUM}" -c cosmocc.zip.sha256sum || die+sha256sum -c cosmocc.zip.sha256sum || die"${UNZIP}" cosmocc.zip || dierm -f cosmocc.zip cosmocc.zip.sha256sum