-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbefore-pr.sh
More file actions
executable file
·41 lines (36 loc) · 1.58 KB
/
before-pr.sh
File metadata and controls
executable file
·41 lines (36 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
#
# __ __
# / /____ ___ ____ ___ ___ _/ / This script is provided to you by https://github.com/tegonal/scripts
# / __/ -_) _ `/ _ \/ _ \/ _ `/ / Copyright 2022 Tegonal Genossenschaft <info@tegonal.com>
# \__/\__/\_, /\___/_//_/\_,_/_/ It is licensed under Apache License 2.0
# /___/ Please report bugs and contribute back your improvements
#
# Version: v4.9.0-SNAPSHOT
###################################
set -euo pipefail
shopt -s inherit_errexit || { echo >&2 "please update to bash 5, see errors above" && exit 1; }
unset CDPATH
if ! [[ -v scriptsDir ]]; then
scriptsDir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" >/dev/null && pwd 2>/dev/null)"
readonly scriptsDir
fi
if ! [[ -v dir_of_tegonal_scripts ]]; then
dir_of_tegonal_scripts="$scriptsDir/../src"
source "$dir_of_tegonal_scripts/setup_tegonal_scripts.sh" "$dir_of_tegonal_scripts"
fi
sourceOnce "$dir_of_tegonal_scripts/utility/checks.sh"
sourceOnce "$dir_of_tegonal_scripts/qa/run-shellspec-if-installed.sh"
sourceOnce "$scriptsDir/check-in-bug-template.sh"
sourceOnce "$scriptsDir/cleanup-on-push-to-main.sh"
sourceOnce "$scriptsDir/run-shellcheck.sh"
function beforePr() {
# using && because this function is used on the left side of an || in releaseFiles
# this way we still have fail fast behaviour and don't mask/hide a non-zero exit code
runShellspecIfInstalled --jobs 2 &&
checkInBugTemplate &&
customRunShellcheck &&
cleanupOnPushToMain
}
${__SOURCED__:+return}
beforePr "$@"