Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add ability to install local binaries
Sebastian Martinez committed 2 years ago
commit def558033cf3e8c0799e8b7c1ea5152b9189b739
parent 7edd6dcdf0f5b8593829e957d6d16af2456f7332
1 file changed +13 -1
modified scripts/install-binaries
@@ -5,6 +5,7 @@ BINARIES=(rad radicle-node radicle-httpd git-remote-rad)
REPO_ROOT=$(git rev-parse --show-toplevel)
REV=$(cat "$REPO_ROOT/tests/support/heartwood-version")
BINARY_PATH=$REPO_ROOT/tests/tmp/bin/${REV:0:7}
+
USE_LOCAL_BINARIES=false
OS=$(uname)

show_usage() {
@@ -16,6 +17,7 @@ show_usage() {
  echo
  echo "OPTIONS:"
  echo "  -s --show-path         Print the binary path, and skip installation."
+
  echo "  -l --local-path        Use local path instead of fetching from radicle.xyz."
  echo "  -h --help              Print this Help."
  echo
}
@@ -26,6 +28,11 @@ while [ $# -ne 0 ]; do
      echo "$BINARY_PATH"
      exit
      ;;
+
    --local-path | -l)
+
      USE_LOCAL_BINARIES=true
+
      SOURCE_PATH=$2
+
      shift 2
+
      ;;
    --help | -h)
      show_usage
      exit
@@ -34,9 +41,11 @@ while [ $# -ne 0 ]; do

done

-

echo
echo "Using revision $REV"
+
if [ "$USE_LOCAL_BINARIES" = true ]; then
+
  echo "Using local binaries from $SOURCE_PATH"
+
fi
echo

mkdir -p "$BINARY_PATH"
@@ -45,6 +54,9 @@ for BINARY_NAME in "${BINARIES[@]}"
do
  if [ -x "$(command -v "$BINARY_PATH/$BINARY_NAME")" ]; then
    echo ✅ "$BINARY_NAME"
+
  elif [ "$USE_LOCAL_BINARIES" = true ]; then
+
    echo Copying "$BINARY_NAME" from "$SOURCE_PATH/$BINARY_NAME"
+
    cp "$SOURCE_PATH/$BINARY_NAME" "$BINARY_PATH/$BINARY_NAME"
  else
    # To provide deterministic Node and Repo IDs, we need a rad CLI compiled with the --debug flag.
    if [ "$BINARY_NAME" = "rad" ]; then