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

16 lines
319 B
Bash
Executable file

#!/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