scripts: declare ROOT closer to where it's used, and some DRY changes
This also prevents shellcheck from complaining about a possibly undefined variable. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -14,10 +14,14 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
|
||||
basedir="$(dirname "${BASH_SOURCE[0]}")"
|
||||
source "${basedir}/utils.sh"
|
||||
|
||||
ROOT="$( cd "${basedir}" && pwd )"/../..
|
||||
cd "${ROOT}"
|
||||
|
||||
# FOCUS focuses the test to run.
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/../..
|
||||
|
||||
IS_WINDOWS=0
|
||||
if [ -v "OS" ] && [ "${OS}" == "Windows_NT" ]; then
|
||||
IS_WINDOWS=1
|
||||
|
||||
Reference in New Issue
Block a user