#!/bin/bash export PATH="/opt/homebrew/bin:$PATH" export REPO_ROOT=/Users/ace/palacering cd /Users/ace/palacering/code/palaceplatform/channels source /Users/ace/palacering/palaces/manglasabang/secretariat/keychain/linear.env LOGDIR="linear/logs" mkdir -p "$LOGDIR" for f in out.log err.log; do if [ -f "$LOGDIR/$f" ] && [ "$(stat -f%z "$LOGDIR/$f" 2>/dev/null)" -gt 1048576 ]; then mv "$LOGDIR/$f" "$LOGDIR/${f%.log}-$(date +%Y%m%d-%H%M%S).log" fi done exec pnpm tsx --no-cache linear/index.ts >> "$LOGDIR/out.log" 2>> "$LOGDIR/err.log"