Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ and add it to the registry in `themesync/targets/__init__.py`.

## Development

No CI: run the local checks before pushing.

```bash
scripts/check.sh # compileall + CLI smoke test (list/dry-run)
python3 -m compileall -q themesync # syntax check
./theme-sync.sh --dry-run # exercise every target without writing
```
Expand Down
50 changes: 50 additions & 0 deletions scripts/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Local checks for the theme-sync engine (no CI):
# - Byte-compile the package.
# - CLI smoke test (list + dry-run) against a local palette checkout.
#
# Palette source resolution: sibling ../palettes checkout first, then the
# installed shell copy. With no palette source the smoke test is skipped.
#
# Usage: scripts/check.sh
set -u
cd "$(dirname "$0")/.." || exit 1

fail=0

if ! python3 -m compileall -q themesync; then
echo "compileall FAIL"
fail=1
else
echo "compileall: OK"
fi

PALETTES=""
for c in "$PWD/../palettes" "$HOME/.config/hypr/scripts/quickshell/dock/palettes"; do
if [ -d "$c" ]; then
PALETTES="$c"
break
fi
done

if [ -n "$PALETTES" ]; then
tmp="$(mktemp)"
printf '{"bar":{"palette":"x"}}\n' > "$tmp"
if ! ./theme-sync.sh --list --palettes "$PALETTES" --settings "$tmp" >/dev/null; then
echo "CLI list FAIL"
fail=1
fi
if ! ./theme-sync.sh --dry-run --palettes "$PALETTES" --settings "$tmp" >/dev/null; then
echo "CLI dry-run FAIL"
fail=1
fi
rm -f "$tmp"
echo "CLI smoke test: OK ($PALETTES)"
else
echo "note: no palette source found, CLI smoke test skipped" >&2
fi

if [ "$fail" -eq 0 ]; then
echo "theme-sync: checks OK"
fi
exit "$fail"
Loading