From 31305a62ac62033d5e4ed3f49eeee0de18706ef3 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Sat, 30 Jul 2022 13:50:08 +0100 Subject: [PATCH 1/2] add fmt.sh --- fmt.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 fmt.sh diff --git a/fmt.sh b/fmt.sh new file mode 100644 index 0000000..045f5d9 --- /dev/null +++ b/fmt.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -eu -o pipefail +shopt -s inherit_errexit + +. "$(dirname "${BASH_SOURCE[0]}")/cmd_runner.sh" + +main() { + # setup. + cmd_runner_setup + cmd_runner_apply_patches --setup-cleanup true + + # format. + cargo +nightly fmt; + + # commit. + git add . + git commit -m "$COMMIT_MESSAGE" + + # Push the results to the target branch + git remote add \ + github \ + "https://token:${GITHUB_TOKEN}@github.com/${GH_CONTRIBUTOR}/${GH_CONTRIBUTOR_REPO}.git" + git push github "HEAD:${GH_CONTRIBUTOR_BRANCH}" +} + +main "$@" From 1416a9581871aa2b9e7820982c3ddc97e4fe4f3c Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Sat, 30 Jul 2022 13:50:56 +0100 Subject: [PATCH 2/2] Update fmt.sh --- fmt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmt.sh b/fmt.sh index 045f5d9..0932c8b 100644 --- a/fmt.sh +++ b/fmt.sh @@ -11,7 +11,7 @@ main() { cmd_runner_apply_patches --setup-cleanup true # format. - cargo +nightly fmt; + cargo +nightly fmt # commit. git add .