Skip to content

Commit

Permalink
[ci] hyperledger#2865: Remove usage of tmp file from scripts/check.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
  • Loading branch information
Erigara authored and appetrosyan committed Nov 17, 2022
1 parent 796fbf6 commit 7c0f857
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions scripts/check.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
#!/bin/sh
set -e

TMPFILE=$(mktemp)

case $1 in
"docs")
cargo run --bin kagami -- docs >"$TMPFILE"
diff "$TMPFILE" docs/source/references/config.md || {
cargo run --bin kagami -- docs | diff - docs/source/references/config.md || {
echo 'Please re-generate docs using `cargo run --bin kagami -- docs > docs/source/references/config.md`'
exit 1
};;
"genesis")
cargo run --bin kagami -- genesis >"$TMPFILE"
diff "$TMPFILE" configs/peer/genesis.json || {
cargo run --bin kagami -- genesis | diff - configs/peer/genesis.json || {
echo 'Please re-generate the genesis with `cargo run --bin kagami -- genesis > configs/peer/genesis.json`'
exit 1
};;
"client")
cargo run --bin kagami -- client >"$TMPFILE"
diff "$TMPFILE" configs/client_cli/config.json || {
cargo run --bin kagami -- client | diff - configs/client_cli/config.json || {
echo 'Please re-generate client config with `cargo run --bin kagami -- client > configs/client_cli/config.json`'
exit 1
};;
"schema")
cargo run --bin kagami -- schema >"$TMPFILE"
diff "$TMPFILE" docs/source/references/schema.json || {
cargo run --bin kagami -- schema | diff - docs/source/references/schema.json || {
echo 'Please re-generate schema with `cargo run --bin kagami -- schema > docs/source/references/schema.json`'
exit 1
};;
Expand Down

0 comments on commit 7c0f857

Please sign in to comment.