Skip to content

Commit

Permalink
Restore patch-section sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Aug 9, 2024
1 parent b6fb6ac commit e39a292
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/cargo/patch-section.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"' _ {}

0 comments on commit e39a292

Please sign in to comment.