forked from Qortal/q-blog
73 lines
1016 B
Bash
Executable File
73 lines
1016 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd)"
|
|
TARGET="$HERE/.gitignore"
|
|
BACKUP="$HERE/.gitignore.bak.$(date +%Y%m%d-%H%M%S)"
|
|
|
|
if [[ -f "$TARGET" ]]; then
|
|
cp "$TARGET" "$BACKUP"
|
|
echo "Backed up existing .gitignore to $(basename "$BACKUP")"
|
|
fi
|
|
|
|
cat > "$TARGET" <<'IGN'
|
|
# --- Q-Blog canonical ignore (Phase 1) ---
|
|
# Logs
|
|
logs
|
|
*.log
|
|
npm-debug.log*
|
|
yarn-debug.log*
|
|
pnpm-debug.log*
|
|
lerna-debug.log*
|
|
|
|
# Packages & archives
|
|
node_modules/
|
|
*.zip
|
|
*.tgz
|
|
|
|
# Build outputs
|
|
dist/
|
|
dist-ssr/
|
|
storybook-static/
|
|
|
|
# Test & coverage
|
|
coverage/
|
|
.nyc_output/
|
|
playwright-report/
|
|
test-results/
|
|
|
|
# Tool caches
|
|
.vite/
|
|
.eslintcache
|
|
.cache/
|
|
.tmp/
|
|
tmp/
|
|
*.tsbuildinfo
|
|
|
|
# Reports (local scans, not tracked)
|
|
reports/
|
|
|
|
# Env files
|
|
.env
|
|
.env.local
|
|
.env.*.local
|
|
|
|
# Editor directories and files
|
|
.vscode/*
|
|
!.vscode/extensions.json
|
|
.idea
|
|
.DS_Store
|
|
*.suo
|
|
*.ntvs*
|
|
*.njsproj
|
|
*.sln
|
|
*.sw?
|
|
|
|
# Releases
|
|
release/
|
|
release-*/
|
|
IGN
|
|
|
|
echo "Applied canonical .gitignore (Phase 1)."
|
|
git status --ignored -s || true
|