From e39a292fa7be8294c9b22ac741b8badb1ca1e309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Fri, 9 Aug 2024 21:29:33 +0900 Subject: [PATCH] Restore patch-section sh --- scripts/cargo/patch-section.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/cargo/patch-section.sh diff --git a/scripts/cargo/patch-section.sh b/scripts/cargo/patch-section.sh new file mode 100755 index 000000000000..6de3730001ff --- /dev/null +++ b/scripts/cargo/patch-section.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -eu + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +function toLine { + # >&2 echo "toLine: $@" + arr=(${1//,/ }) + # >&2 echo "arr: ${arr[0]} ${arr[1]}" + dir="$(dirname ${arr[1]})" + echo "${arr[0]} = { path = '$dir' }" +} + +export -f toLine + +$SCRIPT_DIR/list-crates.sh | jq '[.name, .manifest_path] | @csv' -r | xargs -I {} bash -c 'toLine "$@"' _ {} \ No newline at end of file