From 1a831b2350dd3928b60eb745d0862ee19dd2aaaa Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 26 Nov 2024 15:25:40 +0100 Subject: [PATCH] Address review feedback --- scripts/rpc_repo_to_horizon_repo.sh | 31 +++++++++++++++++++++++++ scripts/soroban_repo_to_horizon_repo.sh | 31 ------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) create mode 100755 scripts/rpc_repo_to_horizon_repo.sh delete mode 100755 scripts/soroban_repo_to_horizon_repo.sh diff --git a/scripts/rpc_repo_to_horizon_repo.sh b/scripts/rpc_repo_to_horizon_repo.sh new file mode 100755 index 00000000..59675239 --- /dev/null +++ b/scripts/rpc_repo_to_horizon_repo.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# rpc_repo_to_horizon_repo.sh - given an rpc branch to horizon branch +# +# Syntax: rpc_repo_to_horizon_repo.sh +# +# Examples: rpc_repo_to_horizon_repo.sh main + +set -e +set -o pipefail + +if [ "$#" -ne 1 ]; then + echo "Syntax: ${0} " + exit 1 +fi + +GO_MONOREPO=github.com/stellar/go +RPC_BRANCH=$1 +RPC_REPO_GOMOD=https://raw.githubusercontent.com/stellar/stellar-rpc/${RPC_BRANCH}/go.mod + +# find the short commit from the stellar-rpc repository. +SHORT_COMMIT=$(curl -s ${RPC_REPO_GOMOD} -o - | grep "${GO_MONOREPO} " | cut -d- -f3) + +# find the long commit from the actual go repository using the short commit. +TEMPDIR=$(mktemp -d) +git clone -q https://${GO_MONOREPO}.git ${TEMPDIR} +CURRENT_DIR=$(pwd) +cd ${TEMPDIR} +git rev-parse ${SHORT_COMMIT} +rm -rf ${TEMPDIR} +cd ${CURRENT_DIR} diff --git a/scripts/soroban_repo_to_horizon_repo.sh b/scripts/soroban_repo_to_horizon_repo.sh deleted file mode 100755 index 7c1b305a..00000000 --- a/scripts/soroban_repo_to_horizon_repo.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -# soroban_repo_to_horizon_repo.sh - given a soroban branch to horizon branch -# -# Syntax: soroban_repo_to_horizon_repo.sh -# -# Examples: soroban_repo_to_horizon_repo.sh main - -set -e -set -o pipefail - -if [ "$#" -ne 1 ]; then - echo "Syntax: ${0} " - exit 1 -fi - -GO_MONOREPO=github.com/stellar/go -SOROBAN_BRANCH=$1 -SOROBAN_REPO_GOMOD=https://raw.githubusercontent.com/stellar/stellar-rpc/${SOROBAN_BRANCH}/go.mod - -# find the short commit from the stellar-rpc repository. -SHORT_COMMIT=$(curl -s ${SOROBAN_REPO_GOMOD} -o - | grep "${GO_MONOREPO} " | cut -d- -f3) - -# find the long commit from the actual go repository using the short commit. -TEMPDIR=$(mktemp -d) -git clone -q https://${GO_MONOREPO}.git ${TEMPDIR} -CURRENT_DIR=$(pwd) -cd ${TEMPDIR} -git rev-parse ${SHORT_COMMIT} -rm -rf ${TEMPDIR} -cd ${CURRENT_DIR}