mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
26 lines
734 B
Text
Executable file
26 lines
734 B
Text
Executable file
#! /usr/bin/env nix-shell
|
|
#! nix-shell -i sh -p python38
|
|
|
|
# SPDX-FileCopyrightText: 2021 Leroy Hopson
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
set -e
|
|
|
|
GDTOOLKIT_VERSION=c514a022f7e566f06a0c68058727737fe0d8b33c
|
|
|
|
FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep '\.gd$' | grep -v '^addons/gd-plug' | grep -v '^addons/gut' | sed 's| |\\ |g')
|
|
echo $FILES
|
|
[ -z "$FILES" ] && exit 0
|
|
|
|
# Setup GDScript Toolkit.
|
|
if [ ! -f .venv/bin/activate ] || ! source .venv/bin/activate; then
|
|
python -m venv .venv && source .venv/bin/activate;
|
|
fi
|
|
if ! gdformat --version; then
|
|
pip install git+https://github.com/Scony/godot-gdscript-toolkit@${GDTOOLKIT_VERSION};
|
|
fi
|
|
|
|
# Lint all selected files.
|
|
echo "$FILES" | xargs gdformat --check
|
|
|
|
exit 0
|