Skip to content

Commit 3ac657f

Browse files
authored
Merge pull request #72 from paritytech/kiz-fmt
add fmt.sh
2 parents d730aeb + 1416a95 commit 3ac657f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

fmt.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu -o pipefail
4+
shopt -s inherit_errexit
5+
6+
. "$(dirname "${BASH_SOURCE[0]}")/cmd_runner.sh"
7+
8+
main() {
9+
# setup.
10+
cmd_runner_setup
11+
cmd_runner_apply_patches --setup-cleanup true
12+
13+
# format.
14+
cargo +nightly fmt
15+
16+
# commit.
17+
git add .
18+
git commit -m "$COMMIT_MESSAGE"
19+
20+
# Push the results to the target branch
21+
git remote add \
22+
github \
23+
"https://token:${GITHUB_TOKEN}@github.com/${GH_CONTRIBUTOR}/${GH_CONTRIBUTOR_REPO}.git"
24+
git push github "HEAD:${GH_CONTRIBUTOR_BRANCH}"
25+
}
26+
27+
main "$@"

0 commit comments

Comments
 (0)