This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
rotini/script/pre-commit

17 lines
319 B
Text
Raw Normal View History

#!/bin/sh
TASKS=""
if [ -n "$(git diff --cached --name-only origin/main -- ./frontend)" ]; then
TASKS="$TASKS fe:lint fe:typecheck"
fi
if [ -n "$(git diff --cached --name-only origin/main -- ./backend)" ]; then
TASKS="$TASKS be:lint"
fi
if [ -n "$TASKS" ]; then
echo "Running $TASKS"
task $TASKS
fi