@sebastienrousseau/dotfiles 0.2.519 → 0.2.521
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +200 -0
- package/LICENSE-APACHE +190 -0
- package/{LICENSE → LICENSE-MIT} +1 -1
- package/README.md +1172 -166
- package/install.sh +77 -11
- package/package.json +8 -8
- package/tools/README.md +49 -0
- package/tools/ci/install-chezmoi-verified.sh +68 -0
- package/docs/.vitepress/reports/localization-readability-audit.md +0 -73
- package/docs/AI.md +0 -179
- package/docs/CNAME +0 -1
- package/docs/CONFIG_STRATEGY.md +0 -124
- package/docs/COPYRIGHT +0 -7
- package/docs/GOVERNANCE.md +0 -98
- package/docs/MAINTAINERS.md +0 -41
- package/docs/NAMING_CONVENTIONS.md +0 -102
- package/docs/OPENCODE.md +0 -127
- package/docs/README.md +0 -84
- package/docs/STRUCTURE.md +0 -102
- package/docs/adr/ADR-001-ci-cd-pipeline.md +0 -118
- package/docs/adr/ADR-002-shell-performance.md +0 -130
- package/docs/adr/ADR-003-security-first.md +0 -158
- package/docs/adr/ADR-004-cli-architecture.md +0 -171
- package/docs/adr/ADR-005-chezmoi-choice.md +0 -99
- package/docs/adr/ADR-006-shell-selection.md +0 -124
- package/docs/adr/ADR-007-multi-shell-parity.md +0 -62
- package/docs/adr/ADR-008-alias-system-architecture.md +0 -95
- package/docs/adr/ADR-009-wallpaper-driven-theming.md +0 -131
- package/docs/adr/ADR-010-starship-transient-prompt.md +0 -144
- package/docs/adr/ADR-011-nushell-tier3-keep.md +0 -144
- package/docs/adr/ADR-012-ai-fleet-local-proxy.md +0 -79
- package/docs/adr/README.md +0 -40
- package/docs/architecture/AI_COST_OPTIMIZATION.md +0 -144
- package/docs/architecture/ARCHITECTURE.md +0 -117
- package/docs/architecture/INTEROP.md +0 -44
- package/docs/architecture/REPO_LAYOUT.md +0 -241
- package/docs/architecture/WALKTHROUGH.md +0 -86
- package/docs/architecture/fleet-deployment.md +0 -77
- package/docs/archive/EUXIS_2026_REVIEW.md +0 -127
- package/docs/archive/LEGACY_ROADMAP.md +0 -6
- package/docs/archive/MILESTONE_v0.2.493.md +0 -47
- package/docs/archive/PLAN.md +0 -199
- package/docs/archive/REPO_AUDIT.md +0 -31
- package/docs/articles/.pages +0 -6
- package/docs/articles/2026-07-05-custom-mkdocs-material-dark-theme.md +0 -216
- package/docs/articles/2026-07-05-fish-startup-abbr.md +0 -153
- package/docs/articles/2026-07-05-master-to-main-rename-runbook.md +0 -128
- package/docs/articles/index.md +0 -36
- package/docs/guides/INSTALL.md +0 -144
- package/docs/guides/NEOVIM_IDE_GUIDE.md +0 -61
- package/docs/guides/THEMING.md +0 -230
- package/docs/guides/TROUBLESHOOTING.md +0 -176
- package/docs/guides/WSL2_NIX_TROUBLESHOOTING.md +0 -792
- package/docs/index.md +0 -132
- package/docs/interop/A2A.md +0 -39
- package/docs/interop/POWERSHELL.md +0 -102
- package/docs/manual/00-introduction.md +0 -89
- package/docs/manual/01-concepts/01-architecture.md +0 -138
- package/docs/manual/01-concepts/02-trust-model.md +0 -183
- package/docs/manual/01-concepts/03-theme-engine.md +0 -186
- package/docs/manual/01-concepts/04-fleet.md +0 -148
- package/docs/manual/01-concepts/05-self-healing.md +0 -204
- package/docs/manual/02-tutorials/01-first-install.md +0 -197
- package/docs/manual/02-tutorials/02-add-wallpaper.md +0 -216
- package/docs/manual/02-tutorials/03-create-profile.md +0 -244
- package/docs/manual/02-tutorials/04-encrypt-secret.md +0 -281
- package/docs/manual/02-tutorials/05-deploy-fleet.md +0 -283
- package/docs/manual/03-reference/01-dot-cli.md +0 -450
- package/docs/manual/03-reference/02-config-files.md +0 -265
- package/docs/manual/03-reference/03-environment.md +0 -124
- package/docs/manual/03-reference/04-templates.md +0 -190
- package/docs/manual/03-reference/05-feature-flags.md +0 -187
- package/docs/manual/04-cookbook/01-recipes.md +0 -285
- package/docs/manual/04-cookbook/02-troubleshooting.md +0 -351
- package/docs/manual/04-cookbook/03-faq.md +0 -175
- package/docs/manual/05-appendices/A-platform-matrix.md +0 -101
- package/docs/manual/05-appendices/B-security-checklist.md +0 -85
- package/docs/manual/05-appendices/C-glossary.md +0 -40
- package/docs/manual/05-appendices/D-bibliography.md +0 -58
- package/docs/manual/05-appendices/E-license.md +0 -38
- package/docs/manual/_toc.yml +0 -58
- package/docs/manual/command-index.md +0 -155
- package/docs/manual/concept-index.md +0 -168
- package/docs/manual/index.md +0 -66
- package/docs/operations/ARCHITECTURE_ROADMAP.md +0 -7
- package/docs/operations/ATTESTATION.md +0 -44
- package/docs/operations/CI_CADENCE.md +0 -107
- package/docs/operations/CI_COMPOSITES.md +0 -156
- package/docs/operations/COMPLETIONS.md +0 -123
- package/docs/operations/COVERAGE.md +0 -204
- package/docs/operations/DRIFT.md +0 -107
- package/docs/operations/HARD_AUDIT_2026.md +0 -631
- package/docs/operations/MAINTENANCE.md +0 -63
- package/docs/operations/MANIFEST.md +0 -127
- package/docs/operations/MIGRATION.md +0 -109
- package/docs/operations/OPERATIONS.md +0 -188
- package/docs/operations/PERFORMANCE.md +0 -133
- package/docs/operations/REGISTRY.md +0 -90
- package/docs/operations/RELEASE_PIPELINE.md +0 -128
- package/docs/operations/RELIABILITY.md +0 -122
- package/docs/operations/RFC_v0_2_503_reorganization.md +0 -280
- package/docs/operations/ROADMAP.md +0 -10
- package/docs/operations/ROADMAP_2026.md +0 -7
- package/docs/operations/ROADMAP_V0_2_503.md +0 -10
- package/docs/operations/TESTING.md +0 -216
- package/docs/operations/TRACEABILITY.md +0 -43
- package/docs/operations/TRUSTED_AGENT_WORKSTATION.md +0 -65
- package/docs/operations/VERSION_SYNC.md +0 -393
- package/docs/reference/ALIASES.md +0 -131
- package/docs/reference/ALIASES_CHEATSHEET.md +0 -32
- package/docs/reference/ALIASES_DEPRECATIONS.md +0 -13
- package/docs/reference/FEATURES.md +0 -66
- package/docs/reference/FONTS.md +0 -112
- package/docs/reference/POWERSHELL_PARITY.md +0 -82
- package/docs/reference/PROFILES.md +0 -69
- package/docs/reference/SCREENSHOTS.md +0 -121
- package/docs/reference/SCRIPTS.md +0 -71
- package/docs/reference/SUPPORT_MATRIX.md +0 -80
- package/docs/reference/THEMES.md +0 -117
- package/docs/reference/TOOLS.md +0 -110
- package/docs/reference/UTILS.md +0 -242
- package/docs/registry.json +0 -6
- package/docs/schema/dot-env-v1.json +0 -110
- package/docs/schema/dot-registry-v1.json +0 -33
- package/docs/security/AI_ACT_COMPLIANCE.md +0 -94
- package/docs/security/AUDIT_BYPASS.md +0 -103
- package/docs/security/AUTOMATION_SECRETS.md +0 -26
- package/docs/security/CI_EGRESS_ALLOWLIST.md +0 -127
- package/docs/security/CI_PINNING.md +0 -129
- package/docs/security/COMMIT_SIGNING.md +0 -138
- package/docs/security/COMPLIANCE.md +0 -458
- package/docs/security/DEPS_DEV_EXCEPTIONS.md +0 -86
- package/docs/security/DISCLOSURE.md +0 -130
- package/docs/security/ENCRYPTION.md +0 -57
- package/docs/security/FMEA.md +0 -159
- package/docs/security/FUZZING.md +0 -114
- package/docs/security/HISTORY_FILTERING.md +0 -132
- package/docs/security/INCIDENT_RESPONSE.md +0 -579
- package/docs/security/INSTALL_VERIFICATION.md +0 -122
- package/docs/security/KEYS.md +0 -49
- package/docs/security/KEY_ROTATION.md +0 -303
- package/docs/security/MCP_POLICY.md +0 -78
- package/docs/security/POLICY_RELEASES.md +0 -37
- package/docs/security/README.md +0 -28
- package/docs/security/SCORECARD.md +0 -195
- package/docs/security/SECRETS.md +0 -158
- package/docs/security/SECURITY.md +0 -45
- package/docs/security/SECURITY_CHECKLIST.md +0 -55
- package/docs/security/SHELL_EXEMPTIONS.md +0 -145
- package/docs/security/SOUP_REGISTER.md +0 -36
- package/docs/security/THREAT_MODEL.md +0 -130
- package/docs/security/VERIFICATION_VALIDATION.md +0 -228
- package/docs/security/VERIFY_RELEASE.md +0 -201
- package/docs/security/security-pubkey.asc +0 -15
- package/docs/stylesheets/extra.css +0 -444
- package/docs/themes/README.md +0 -10
- package/docs/themes/VISUAL_INTEGRITY_REPORT.md +0 -30
- package/docs/themes/hero-shot.svg +0 -78
- package/scripts/README.md +0 -123
- package/scripts/ci/check-copyright-headers.sh +0 -8
- package/scripts/ci/check-shell-preamble.sh +0 -8
- package/scripts/ci/guard-gitleaks-checkout.sh +0 -8
- package/scripts/demo/record.sh +0 -43
- package/scripts/diagnostics/a2a-conformance.sh +0 -163
- package/scripts/diagnostics/alias-governance.sh +0 -138
- package/scripts/diagnostics/aliases-cheatsheet.sh +0 -74
- package/scripts/diagnostics/aliases-manifest.sh +0 -77
- package/scripts/diagnostics/benchmark.sh +0 -408
- package/scripts/diagnostics/conflicts.sh +0 -73
- package/scripts/diagnostics/doctor-unified.sh +0 -39
- package/scripts/diagnostics/doctor.sh +0 -751
- package/scripts/diagnostics/drift-dashboard.sh +0 -202
- package/scripts/diagnostics/health.sh +0 -623
- package/scripts/diagnostics/history-analysis.sh +0 -86
- package/scripts/diagnostics/mcp-doctor.sh +0 -582
- package/scripts/diagnostics/perf.sh +0 -453
- package/scripts/diagnostics/scorecard.sh +0 -119
- package/scripts/diagnostics/secret-governance.sh +0 -65
- package/scripts/diagnostics/security-score.sh +0 -467
- package/scripts/diagnostics/smoke-test.sh +0 -88
- package/scripts/diagnostics/snapshot.sh +0 -90
- package/scripts/diagnostics/verify.sh +0 -108
- package/scripts/diagnostics/verify_state.sh +0 -73
- package/scripts/diagnostics/version-locks.sh +0 -94
- package/scripts/diagnostics/workstation-attestation.sh +0 -187
- package/scripts/dot/commands/agent.sh +0 -485
- package/scripts/dot/commands/agents.sh +0 -336
- package/scripts/dot/commands/ai.sh +0 -587
- package/scripts/dot/commands/aliases.sh +0 -277
- package/scripts/dot/commands/appearance.sh +0 -110
- package/scripts/dot/commands/completion.sh +0 -134
- package/scripts/dot/commands/core.sh +0 -217
- package/scripts/dot/commands/diagnostics.sh +0 -265
- package/scripts/dot/commands/env-emit.sh +0 -203
- package/scripts/dot/commands/fleet.sh +0 -688
- package/scripts/dot/commands/init.sh +0 -185
- package/scripts/dot/commands/lint.sh +0 -208
- package/scripts/dot/commands/manual.sh +0 -169
- package/scripts/dot/commands/meta.sh +0 -333
- package/scripts/dot/commands/patterns.sh +0 -55
- package/scripts/dot/commands/registry.sh +0 -419
- package/scripts/dot/commands/restore.sh +0 -232
- package/scripts/dot/commands/secrets.sh +0 -296
- package/scripts/dot/commands/security.sh +0 -102
- package/scripts/dot/commands/tools.sh +0 -556
- package/scripts/dot/data/alias-deprecations.tsv +0 -2
- package/scripts/dot/powershell/Dot.psm1 +0 -319
- package/scripts/fonts/install-nerd-fonts.sh +0 -75
- package/scripts/fonts/patch-fonts.sh +0 -36
- package/scripts/git-hooks/install.sh +0 -12
- package/scripts/git-hooks/pre-commit +0 -12
- package/scripts/git-hooks/pre-commit-audit.sh +0 -146
- package/scripts/git-hooks/pre-push +0 -105
- package/scripts/git-hooks/prepare-commit-msg +0 -29
- package/scripts/lib/secrets_provider.sh +0 -185
- package/scripts/ops/ai-setup.sh +0 -71
- package/scripts/ops/bundle.sh +0 -104
- package/scripts/ops/chaos.sh +0 -50
- package/scripts/ops/chezmoi-apply.sh +0 -333
- package/scripts/ops/chezmoi-diff.sh +0 -16
- package/scripts/ops/chezmoi-remove.sh +0 -46
- package/scripts/ops/chezmoi-update.sh +0 -63
- package/scripts/ops/heal-chezmoi.sh +0 -87
- package/scripts/ops/heal-system.sh +0 -129
- package/scripts/ops/heal-tools.sh +0 -297
- package/scripts/ops/heal.sh +0 -223
- package/scripts/ops/post-apply-repair.sh +0 -107
- package/scripts/ops/prewarm.sh +0 -128
- package/scripts/ops/release.sh +0 -262
- package/scripts/ops/rollback.sh +0 -604
- package/scripts/ops/setup.sh +0 -138
- package/scripts/ops/teleport.sh +0 -34
- package/scripts/qa/check-version-consistency.sh +0 -124
- package/scripts/qa/coverage-baseline.sh +0 -61
- package/scripts/qa/docs-coverage.sh +0 -112
- package/scripts/qa/examples-coverage.sh +0 -94
- package/scripts/qa/powershell-contract.ps1 +0 -95
- package/scripts/qa/reliability-audit.sh +0 -139
- package/scripts/qa/scorecard-snapshot.sh +0 -128
- package/scripts/qa/traceability-coverage.sh +0 -117
- package/scripts/qa/validate-examples.sh +0 -27
- package/scripts/qa/wsl-contract.sh +0 -12
- package/scripts/secrets/age-init.sh +0 -82
- package/scripts/secrets/create-secrets-file.sh +0 -46
- package/scripts/secrets/encrypt-ssh-key.sh +0 -44
- package/scripts/security/backup.sh +0 -58
- package/scripts/security/check-disclosure-key-expiry.sh +0 -111
- package/scripts/security/dns-doh.sh +0 -52
- package/scripts/security/encryption-check.sh +0 -55
- package/scripts/security/enforce-policies.sh +0 -335
- package/scripts/security/firewall.sh +0 -91
- package/scripts/security/lock-configs.sh +0 -67
- package/scripts/security/lock-screen.sh +0 -56
- package/scripts/security/manage-secrets.sh +0 -429
- package/scripts/security/ssh-cert.sh +0 -204
- package/scripts/security/telemetry-kill.sh +0 -51
- package/scripts/security/usb-safety.sh +0 -52
- package/scripts/theme/apply-gnome-theme.sh +0 -333
- package/scripts/theme/extract-heic-frames.sh +0 -115
- package/scripts/theme/extract-theme.py +0 -742
- package/scripts/theme/install-boot-logo.sh +0 -63
- package/scripts/theme/install-catppuccin-themes.sh +0 -371
- package/scripts/theme/install-cursors.sh +0 -26
- package/scripts/theme/install-file-icons.sh +0 -27
- package/scripts/theme/install-grub-theme.sh +0 -62
- package/scripts/theme/install-lock-icon.sh +0 -31
- package/scripts/theme/merge-wallpaper.sh +0 -146
- package/scripts/theme/rebuild-themes.sh +0 -544
- package/scripts/theme/switch.sh +0 -449
- package/scripts/theme/wallpaper-rotate.sh +0 -137
- package/scripts/theme/wallpaper-sync.sh +0 -690
- package/scripts/tools/cmatrix.sh +0 -22
- package/scripts/tools/detect-collisions.py +0 -103
- package/scripts/tools/emoji-picker.sh +0 -49
- package/scripts/tools/figlet-banner.sh +0 -19
- package/scripts/tools/log-rotate.sh +0 -31
- package/scripts/tools/lolcat-wrap.sh +0 -20
- package/scripts/tools/pipes.sh +0 -49
- package/scripts/tuning/linux.sh +0 -186
- package/scripts/tuning/macos.sh +0 -56
- package/scripts/uninstall.sh +0 -86
- package/scripts/version-sync.sh +0 -654
- package/templates/chezmoi-data/geekom-a9.toml.example +0 -21
- package/templates/chezmoi-data/mac-m1.toml.example +0 -16
- package/templates/chezmoi-data/mac-t2-linux.toml.example +0 -21
- package/templates/chezmoi-data/surface-pro-7p.toml.example +0 -21
- package/templates/projects/go/.github/workflows/ci.yml +0 -31
- package/templates/projects/go/README.md +0 -7
- package/templates/projects/go/cmd/__PROJECT_NAME__/main.go +0 -8
- package/templates/projects/go/go.mod +0 -3
- package/templates/projects/go/go.sum +0 -0
- package/templates/projects/molecule/README.md +0 -7
- package/templates/projects/molecule/converge.yml +0 -7
- package/templates/projects/molecule/molecule.yml +0 -16
- package/templates/projects/node/.github/workflows/ci.yml +0 -30
- package/templates/projects/node/README.md +0 -7
- package/templates/projects/node/package-lock.json +0 -12
- package/templates/projects/node/package.json +0 -10
- package/templates/projects/node/src/index.js +0 -3
- package/templates/projects/packer/README.md +0 -15
- package/templates/projects/packer/main.pkr.hcl +0 -15
- package/templates/projects/python/.github/workflows/ci.yml +0 -34
- package/templates/projects/python/README.md +0 -7
- package/templates/projects/python/pyproject.toml +0 -25
- package/templates/projects/python/src/__PROJECT_NAME__/__init__.py +0 -2
- package/templates/projects/python/tests/test_basic.py +0 -3
package/scripts/version-sync.sh
DELETED
|
@@ -1,654 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
# Copyright (c) 2015-2026 Sebastien Rousseau
|
|
4
|
-
# Version Synchronization Script
|
|
5
|
-
# Synchronizes version numbers across all markdown files with package.json
|
|
6
|
-
# Used by CI/CD and available for local testing
|
|
7
|
-
|
|
8
|
-
set -euo pipefail
|
|
9
|
-
|
|
10
|
-
_cleanup_files=()
|
|
11
|
-
trap 'set +u; rm -f "${_cleanup_files[@]}" 2>/dev/null; set -u' EXIT
|
|
12
|
-
|
|
13
|
-
# Configuration
|
|
14
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
15
|
-
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
16
|
-
VERSION_PATTERN='[0-9]+\.[0-9]+\.[0-9]+'
|
|
17
|
-
SED_VERSION_PATTERN='[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
|
|
18
|
-
BACKUP_DIR="$PROJECT_ROOT/.version-sync-backup"
|
|
19
|
-
EXCLUDE_FILES=(
|
|
20
|
-
# Historical / referential docs — version refs inside are intentional
|
|
21
|
-
# pointers at prior versions, not "this is the current version" claims.
|
|
22
|
-
"CHANGELOG.md"
|
|
23
|
-
"docs/security/COMPLIANCE.md"
|
|
24
|
-
"docs/reference/FONTS.md"
|
|
25
|
-
"docs/archive/LEGACY_ROADMAP.md"
|
|
26
|
-
"docs/archive/PLAN.md"
|
|
27
|
-
"ROADMAP.md"
|
|
28
|
-
|
|
29
|
-
# Roadmap + audit narratives — describe per-version work; refs to
|
|
30
|
-
# prior versions are intentional and historical.
|
|
31
|
-
"docs/operations/ROADMAP_V0_2_503.md"
|
|
32
|
-
"docs/operations/VERSION_SYNC.md"
|
|
33
|
-
"docs/operations/RFC_v0_2_503_reorganization.md"
|
|
34
|
-
"docs/operations/HARD_AUDIT_2026.md"
|
|
35
|
-
"docs/operations/COVERAGE.md"
|
|
36
|
-
"docs/reference/ALIASES_DEPRECATIONS.md"
|
|
37
|
-
|
|
38
|
-
# Security docs — INSTALL_VERIFICATION + CI_PINNING + SCORECARD
|
|
39
|
-
# carry per-release hash tables / closed-cycle logs. The "current"
|
|
40
|
-
# version inside these is tracked by hand, not by version-sync.
|
|
41
|
-
"docs/security/CI_PINNING.md"
|
|
42
|
-
"docs/security/INSTALL_VERIFICATION.md"
|
|
43
|
-
"docs/security/SCORECARD.md"
|
|
44
|
-
|
|
45
|
-
# Release-verification recipes use an example pinned tag
|
|
46
|
-
# that intentionally stays at a known-published release.
|
|
47
|
-
"docs/security/VERIFY_RELEASE.md"
|
|
48
|
-
|
|
49
|
-
# Example bundles — version refs in README'd examples are illustrative.
|
|
50
|
-
"examples/mise-plugin-dot/README.md"
|
|
51
|
-
|
|
52
|
-
# MANIFEST + MIGRATION docs — describe per-version manifests &
|
|
53
|
-
# cross-version migration paths; intentional references to other tags.
|
|
54
|
-
"docs/operations/MANIFEST.md"
|
|
55
|
-
"docs/operations/MIGRATION.md"
|
|
56
|
-
|
|
57
|
-
# ADR + architecture + manual + operations narratives — every
|
|
58
|
-
# version reference inside is dated context, not a "current version"
|
|
59
|
-
# claim. The single source-of-truth is .chezmoidata.toml (plus
|
|
60
|
-
# README, package.json — which version-sync DOES rewrite).
|
|
61
|
-
"docs/adr/ADR-007-multi-shell-parity.md"
|
|
62
|
-
"docs/architecture/REPO_LAYOUT.md"
|
|
63
|
-
"docs/manual/01-concepts/04-fleet.md"
|
|
64
|
-
"docs/manual/01-concepts/05-self-healing.md"
|
|
65
|
-
"docs/manual/02-tutorials/05-deploy-fleet.md"
|
|
66
|
-
"docs/manual/05-appendices/D-bibliography.md"
|
|
67
|
-
"docs/operations/MAINTENANCE.md"
|
|
68
|
-
|
|
69
|
-
# Release-process / structural docs that reference *historical* dotfiles
|
|
70
|
-
# versions (the repo reorg, past release tags, migration scenarios).
|
|
71
|
-
# Bumping these each release would corrupt accurate history.
|
|
72
|
-
"docs/operations/RELEASE_PIPELINE.md"
|
|
73
|
-
"docs/operations/TESTING.md"
|
|
74
|
-
"docs/STRUCTURE.md"
|
|
75
|
-
"install/migrate/README.md"
|
|
76
|
-
"install/README.md"
|
|
77
|
-
"tools/README.md"
|
|
78
|
-
"defaults/README.md"
|
|
79
|
-
|
|
80
|
-
# CI_COMPOSITES.md cites third-party action versions (e.g. v5.0.5),
|
|
81
|
-
# not dotfiles_version. False-positive pattern match.
|
|
82
|
-
"docs/operations/CI_COMPOSITES.md"
|
|
83
|
-
|
|
84
|
-
# Living roadmap: references branch names / target versions
|
|
85
|
-
# (e.g. feature-branch names like feat/v0.2.X, phase milestones)
|
|
86
|
-
# that are NOT the current dotfiles_version. Auto-syncing
|
|
87
|
-
# rewrites them incorrectly.
|
|
88
|
-
"docs/operations/ARCHITECTURE_ROADMAP.md"
|
|
89
|
-
|
|
90
|
-
# Dated release write-ups: each article records the release it
|
|
91
|
-
# shipped in (e.g. "shipped in vX.Y.Z" + a link to that release
|
|
92
|
-
# tag). Those refs are historical fact, not current-version claims —
|
|
93
|
-
# bumping them would falsify the history.
|
|
94
|
-
"docs/articles/2026-07-05-fish-startup-abbr.md"
|
|
95
|
-
"docs/articles/2026-07-05-master-to-main-rename-runbook.md"
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
# shellcheck source=../lib/dot/ui.sh
|
|
99
|
-
# shellcheck disable=SC1091
|
|
100
|
-
source "$SCRIPT_DIR/../lib/dot/ui.sh"
|
|
101
|
-
ui_init
|
|
102
|
-
|
|
103
|
-
# Functions — delegate to shared ui.sh (redirect to stderr for script output)
|
|
104
|
-
log_info() { ui_info "$@" >&2; }
|
|
105
|
-
log_success() { ui_ok "$@" >&2; }
|
|
106
|
-
log_warning() { ui_warn "$@" >&2; }
|
|
107
|
-
log_error() { ui_err "$@" >&2; }
|
|
108
|
-
|
|
109
|
-
show_help() {
|
|
110
|
-
cat <<EOF
|
|
111
|
-
Version Synchronization Script
|
|
112
|
-
|
|
113
|
-
USAGE:
|
|
114
|
-
$0 [OPTIONS] [VERSION]
|
|
115
|
-
|
|
116
|
-
OPTIONS:
|
|
117
|
-
-h, --help Show this help message
|
|
118
|
-
-d, --dry-run Show what would be changed without making changes
|
|
119
|
-
-v, --verify Verify version consistency without updating
|
|
120
|
-
-b, --backup Create backup before changes (default: true)
|
|
121
|
-
--no-backup Skip creating backup
|
|
122
|
-
-f, --force Force sync even if no changes detected
|
|
123
|
-
|
|
124
|
-
ARGUMENTS:
|
|
125
|
-
VERSION Target version to sync to (defaults to package.json version)
|
|
126
|
-
|
|
127
|
-
EXAMPLES:
|
|
128
|
-
$0 # Sync to current package.json version
|
|
129
|
-
$0 1.2.3 # Sync all files to version 1.2.3
|
|
130
|
-
$0 --dry-run # Preview changes without applying
|
|
131
|
-
$0 --verify # Check current version consistency
|
|
132
|
-
|
|
133
|
-
DESCRIPTION:
|
|
134
|
-
This script synchronizes version numbers across all markdown files in the
|
|
135
|
-
repository with the version specified in package.json. It updates various
|
|
136
|
-
version reference patterns including badges, documentation headers, and
|
|
137
|
-
feature version stamps.
|
|
138
|
-
|
|
139
|
-
EOF
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
is_excluded_file() {
|
|
143
|
-
local file="$1"
|
|
144
|
-
local excluded
|
|
145
|
-
for excluded in "${EXCLUDE_FILES[@]}"; do
|
|
146
|
-
if [[ "$file" == "$excluded" ]]; then
|
|
147
|
-
return 0
|
|
148
|
-
fi
|
|
149
|
-
done
|
|
150
|
-
return 1
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
get_package_version() {
|
|
154
|
-
local package_file="$PROJECT_ROOT/package.json"
|
|
155
|
-
if [[ ! -f "$package_file" ]]; then
|
|
156
|
-
log_error "package.json not found at $package_file"
|
|
157
|
-
exit 1
|
|
158
|
-
fi
|
|
159
|
-
|
|
160
|
-
local version
|
|
161
|
-
if command -v jq &>/dev/null; then
|
|
162
|
-
version=$(jq -r '.version' "$package_file" 2>/dev/null)
|
|
163
|
-
else
|
|
164
|
-
version=$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' "$package_file" | head -n 1)
|
|
165
|
-
fi
|
|
166
|
-
if [[ "$version" == "null" || -z "$version" ]]; then
|
|
167
|
-
log_error "Could not extract version from package.json"
|
|
168
|
-
exit 1
|
|
169
|
-
fi
|
|
170
|
-
|
|
171
|
-
echo "$version"
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
validate_version() {
|
|
175
|
-
local version="$1"
|
|
176
|
-
if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
177
|
-
log_error "Invalid version format: $version (expected: x.y.z)"
|
|
178
|
-
exit 1
|
|
179
|
-
fi
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
find_version_files() {
|
|
183
|
-
local temp_file
|
|
184
|
-
temp_file=$(umask 077 && mktemp)
|
|
185
|
-
|
|
186
|
-
log_info "Scanning for markdown files with version references..."
|
|
187
|
-
|
|
188
|
-
# Find all markdown files with version patterns.
|
|
189
|
-
# The "." path is required: with no path and a non-TTY stdin (CI, pipes,
|
|
190
|
-
# background jobs) rg reads from stdin instead of searching the tree, so
|
|
191
|
-
# the whole script hangs forever. The `sed` strips rg's leading "./" so
|
|
192
|
-
# the paths match the EXCLUDE_FILES entries (which have no "./"),
|
|
193
|
-
# otherwise excluded historical docs get rewritten.
|
|
194
|
-
cd "$PROJECT_ROOT"
|
|
195
|
-
if command -v rg &>/dev/null; then
|
|
196
|
-
rg -l "v?$VERSION_PATTERN" --type md . 2>/dev/null | sed 's|^\./||' >"$temp_file" || true
|
|
197
|
-
else
|
|
198
|
-
{
|
|
199
|
-
while IFS= read -r file; do
|
|
200
|
-
if grep -Eq "v?$VERSION_PATTERN" "$file" 2>/dev/null; then
|
|
201
|
-
printf '%s\n' "${file#./}"
|
|
202
|
-
fi
|
|
203
|
-
done < <(find . -type f -name '*.md' -print)
|
|
204
|
-
} >"$temp_file"
|
|
205
|
-
fi
|
|
206
|
-
|
|
207
|
-
# Add known files that should be checked even if they don't have versions yet
|
|
208
|
-
# Non-markdown and hidden-directory surfaces rg's `--type md` scan above
|
|
209
|
-
# cannot reach: a shell script, and READMEs under the dotfile-hidden
|
|
210
|
-
# `.chezmoitemplates/` tree (rg skips dot-dirs without --hidden). These
|
|
211
|
-
# carry "current version" stamps that check-version-consistency.sh and
|
|
212
|
-
# the test_version_consistency unit test enforce, so keep them in sync.
|
|
213
|
-
printf '%s\n' \
|
|
214
|
-
"README.md" \
|
|
215
|
-
"docs/reference/FEATURES.md" \
|
|
216
|
-
"docs/COPYRIGHT" \
|
|
217
|
-
"scripts/git-hooks/pre-commit-audit.sh" \
|
|
218
|
-
"defaults/.chezmoitemplates/README.md" \
|
|
219
|
-
"defaults/.chezmoitemplates/functions/README.md" \
|
|
220
|
-
"defaults/.chezmoitemplates/aliases/README.md" >>"$temp_file"
|
|
221
|
-
|
|
222
|
-
# Remove duplicates and filter existing files
|
|
223
|
-
sort -u "$temp_file" | while IFS= read -r file; do
|
|
224
|
-
if [[ -f "$file" ]]; then
|
|
225
|
-
if is_excluded_file "$file"; then
|
|
226
|
-
continue
|
|
227
|
-
fi
|
|
228
|
-
echo "$file"
|
|
229
|
-
fi
|
|
230
|
-
done
|
|
231
|
-
|
|
232
|
-
rm -f "$temp_file"
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
sed_in_place() {
|
|
236
|
-
local file="$1"
|
|
237
|
-
shift
|
|
238
|
-
|
|
239
|
-
if sed --version >/dev/null 2>&1; then
|
|
240
|
-
sed -E -i "$@" "$file"
|
|
241
|
-
else
|
|
242
|
-
sed -E -i '' "$@" "$file"
|
|
243
|
-
fi
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
# LCOV_EXCL_START — rm -rf BACKUP_DIR + cp of real release files;
|
|
247
|
-
# only run during a real release flow, not safe under coverage.
|
|
248
|
-
create_backup() {
|
|
249
|
-
local files=("$@")
|
|
250
|
-
|
|
251
|
-
if [[ ${#files[@]} -eq 0 ]]; then
|
|
252
|
-
log_warning "No files to backup"
|
|
253
|
-
return
|
|
254
|
-
fi
|
|
255
|
-
|
|
256
|
-
log_info "Creating backup in $BACKUP_DIR"
|
|
257
|
-
rm -rf "$BACKUP_DIR"
|
|
258
|
-
mkdir -p "$BACKUP_DIR"
|
|
259
|
-
|
|
260
|
-
local backup_count=0
|
|
261
|
-
for file in "${files[@]}"; do
|
|
262
|
-
if [[ -f "$file" ]]; then
|
|
263
|
-
local backup_name
|
|
264
|
-
backup_name="$(basename "$file").$(date +%Y%m%d_%H%M%S).backup"
|
|
265
|
-
cp "$file" "$BACKUP_DIR/$backup_name"
|
|
266
|
-
backup_count=$((backup_count + 1))
|
|
267
|
-
fi
|
|
268
|
-
done
|
|
269
|
-
|
|
270
|
-
log_success "Backed up $backup_count files"
|
|
271
|
-
}
|
|
272
|
-
# LCOV_EXCL_STOP
|
|
273
|
-
|
|
274
|
-
update_version_references() {
|
|
275
|
-
local target_version="$1"
|
|
276
|
-
local dry_run="$2"
|
|
277
|
-
local files=("${@:3}")
|
|
278
|
-
|
|
279
|
-
local changes_made=0
|
|
280
|
-
local files_processed=0
|
|
281
|
-
|
|
282
|
-
for file in "${files[@]}"; do
|
|
283
|
-
if [[ ! -f "$file" ]]; then
|
|
284
|
-
log_warning "File not found: $file"
|
|
285
|
-
continue
|
|
286
|
-
fi
|
|
287
|
-
files_processed=$((files_processed + 1))
|
|
288
|
-
|
|
289
|
-
# Skip milestone and other historical files
|
|
290
|
-
if [[ "$(basename "$file")" == MILESTONE_* ]]; then
|
|
291
|
-
log_info "Skipping historical file: $file"
|
|
292
|
-
continue
|
|
293
|
-
fi
|
|
294
|
-
|
|
295
|
-
# Create temporary file for changes
|
|
296
|
-
local temp_file
|
|
297
|
-
temp_file=$(umask 077 && mktemp)
|
|
298
|
-
cp "$file" "$temp_file"
|
|
299
|
-
|
|
300
|
-
# Update various version reference patterns. Match on the full repo
|
|
301
|
-
# path (not basename) so the root README's badge rules don't also
|
|
302
|
-
# capture other README.md files (e.g. the .chezmoitemplates READMEs),
|
|
303
|
-
# which carry a `(vX.Y.Z)` stamp handled by the generic case below.
|
|
304
|
-
case "$file" in
|
|
305
|
-
"README.md")
|
|
306
|
-
# Update badge and release link versions.
|
|
307
|
-
sed_in_place "$temp_file" \
|
|
308
|
-
-e "s|Version-v$SED_VERSION_PATTERN|Version-v$target_version|g" \
|
|
309
|
-
-e "s|/releases/tag/v$SED_VERSION_PATTERN|/releases/tag/v$target_version|g" \
|
|
310
|
-
-e "s|/dotfiles/v$SED_VERSION_PATTERN/|/dotfiles/v$target_version/|g"
|
|
311
|
-
;;
|
|
312
|
-
"scripts/git-hooks/pre-commit-audit.sh")
|
|
313
|
-
# "vX.Y.Z standards maintained" banner. Matched explicitly with a
|
|
314
|
-
# portable pattern — the generic `\bvX.Y.Z\b` rule below relies on
|
|
315
|
-
# GNU `\b`, which BSD/macOS sed does not support, so a local
|
|
316
|
-
# `version-sync` run would otherwise leave this script stale.
|
|
317
|
-
sed_in_place "$temp_file" \
|
|
318
|
-
-e "s|v$SED_VERSION_PATTERN standards maintained|v$target_version standards maintained|g"
|
|
319
|
-
;;
|
|
320
|
-
"docs/manual/00-introduction.md")
|
|
321
|
-
sed_in_place "$temp_file" \
|
|
322
|
-
-e "s|\.dotfiles\` v$SED_VERSION_PATTERN|.dotfiles\` v$target_version|g"
|
|
323
|
-
;;
|
|
324
|
-
*)
|
|
325
|
-
# Update explicit markdown version labels, backticks, and parentheses.
|
|
326
|
-
# Skip lines containing MILESTONE.
|
|
327
|
-
sed_in_place "$temp_file" \
|
|
328
|
-
-e "/MILESTONE/!s|(\*\*Version\*\*:[[:space:]]*)v?$SED_VERSION_PATTERN|\\1v$target_version|g" \
|
|
329
|
-
-e "/MILESTONE/!s|(\*\*Dotfiles Version\*\*:[[:space:]]*)v?$SED_VERSION_PATTERN|\\1v$target_version|g" \
|
|
330
|
-
-e "/MILESTONE/!s|(Version:[[:space:]]*)v?$SED_VERSION_PATTERN|\\1v$target_version|g" \
|
|
331
|
-
-e "/MILESTONE/!s|(Dotfiles Version:[[:space:]]*)v?$SED_VERSION_PATTERN|\\1v$target_version|g" \
|
|
332
|
-
-e "/MILESTONE/!s|Version[[:space:]]*\`v?$SED_VERSION_PATTERN\`|Version \`$target_version\`|g" \
|
|
333
|
-
-e "/MILESTONE/!s|\(v$SED_VERSION_PATTERN\)|\(v$target_version\)|g" \
|
|
334
|
-
-e "/MILESTONE/!s|/v$SED_VERSION_PATTERN/|/v$target_version/|g" \
|
|
335
|
-
-e "/MILESTONE/!s|\bv$SED_VERSION_PATTERN\b|v$target_version|g" \
|
|
336
|
-
-e "/MILESTONE/!s|dotfiles:v?$SED_VERSION_PATTERN|dotfiles:$target_version|g" \
|
|
337
|
-
-e "/MILESTONE/!s|notes — v$SED_VERSION_PATTERN|notes — v$target_version|g"
|
|
338
|
-
;;
|
|
339
|
-
esac
|
|
340
|
-
|
|
341
|
-
# Check if file was changed
|
|
342
|
-
if ! cmp -s "$file" "$temp_file"; then
|
|
343
|
-
if [[ "$dry_run" == "true" ]]; then
|
|
344
|
-
log_info "Would update: $file"
|
|
345
|
-
# Show diff preview
|
|
346
|
-
diff -u "$file" "$temp_file" | head -20 >&2 || true
|
|
347
|
-
else
|
|
348
|
-
# Use cat to preserve permissions and ownership
|
|
349
|
-
cat "$temp_file" >"$file"
|
|
350
|
-
log_success "Updated: $file"
|
|
351
|
-
fi
|
|
352
|
-
rm -f "$temp_file"
|
|
353
|
-
changes_made=$((changes_made + 1))
|
|
354
|
-
else
|
|
355
|
-
log_info "No changes needed: $file"
|
|
356
|
-
rm -f "$temp_file"
|
|
357
|
-
fi
|
|
358
|
-
done
|
|
359
|
-
|
|
360
|
-
if [[ "$dry_run" == "true" ]]; then
|
|
361
|
-
log_info "Dry run complete - $changes_made files would be updated out of $files_processed processed"
|
|
362
|
-
else
|
|
363
|
-
log_success "Updated $changes_made files out of $files_processed processed"
|
|
364
|
-
fi
|
|
365
|
-
|
|
366
|
-
echo "$changes_made"
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
verify_version_consistency() {
|
|
370
|
-
local expected_version="$1"
|
|
371
|
-
local files=("${@:2}")
|
|
372
|
-
|
|
373
|
-
log_info "Verifying version consistency (expected: v$expected_version)"
|
|
374
|
-
|
|
375
|
-
local inconsistencies=0
|
|
376
|
-
local total_checked=0
|
|
377
|
-
|
|
378
|
-
for file in "${files[@]}"; do
|
|
379
|
-
if [[ ! -f "$file" ]]; then
|
|
380
|
-
continue
|
|
381
|
-
fi
|
|
382
|
-
|
|
383
|
-
if [[ "$(basename "$file")" == MILESTONE_* ]]; then
|
|
384
|
-
log_info "Skipping historical file: $file"
|
|
385
|
-
continue
|
|
386
|
-
fi
|
|
387
|
-
|
|
388
|
-
total_checked=$((total_checked + 1))
|
|
389
|
-
|
|
390
|
-
# Extract only dotfiles-targeted version references (ignore unrelated tool versions).
|
|
391
|
-
local versions_in_file=()
|
|
392
|
-
if command -v rg &>/dev/null; then
|
|
393
|
-
while IFS= read -r match; do
|
|
394
|
-
while IFS= read -r version; do
|
|
395
|
-
versions_in_file+=("$version")
|
|
396
|
-
done < <(printf "%s\n" "$match" | rg -o "v?$VERSION_PATTERN" || true)
|
|
397
|
-
done < <(
|
|
398
|
-
rg -v "MILESTONE" "$file" 2>/dev/null | rg -o \
|
|
399
|
-
-e "Version-v$VERSION_PATTERN" \
|
|
400
|
-
-e "/releases/tag/v$VERSION_PATTERN" \
|
|
401
|
-
-e "/dotfiles/v$VERSION_PATTERN/" \
|
|
402
|
-
-e "\\*\\*Version\\*\\*:[[:space:]]*v?$VERSION_PATTERN" \
|
|
403
|
-
-e "\\*\\*Dotfiles Version\\*\\*:[[:space:]]*v?$VERSION_PATTERN" \
|
|
404
|
-
-e "(^|[[:space:]])Version:[[:space:]]*v?$VERSION_PATTERN" \
|
|
405
|
-
-e "(^|[[:space:]])Dotfiles Version:[[:space:]]*v?$VERSION_PATTERN" \
|
|
406
|
-
-e "Version[[:space:]]*\`v?$VERSION_PATTERN\`" \
|
|
407
|
-
-e "\\(v$VERSION_PATTERN\\)" \
|
|
408
|
-
-e "/v$VERSION_PATTERN/" \
|
|
409
|
-
-e "v$VERSION_PATTERN\\b" \
|
|
410
|
-
-e "dotfiles:v?$VERSION_PATTERN" \
|
|
411
|
-
-e "notes — v$VERSION_PATTERN" || true
|
|
412
|
-
)
|
|
413
|
-
else
|
|
414
|
-
while IFS= read -r match; do
|
|
415
|
-
while IFS= read -r version; do
|
|
416
|
-
versions_in_file+=("$version")
|
|
417
|
-
done < <(printf "%s\n" "$match" | grep -Eo "v?$VERSION_PATTERN" || true)
|
|
418
|
-
done < <(
|
|
419
|
-
grep -Ev "MILESTONE" "$file" 2>/dev/null | grep -Eo \
|
|
420
|
-
-e "Version-v$VERSION_PATTERN" \
|
|
421
|
-
-e "/releases/tag/v$VERSION_PATTERN" \
|
|
422
|
-
-e "/dotfiles/v$VERSION_PATTERN/" \
|
|
423
|
-
-e "\\*\\*Version\\*\\*:[[:space:]]*v?$VERSION_PATTERN" \
|
|
424
|
-
-e "\\*\\*Dotfiles Version\\*\\*:[[:space:]]*v?$VERSION_PATTERN" \
|
|
425
|
-
-e "(^|[[:space:]])Version:[[:space:]]*v?$VERSION_PATTERN" \
|
|
426
|
-
-e "(^|[[:space:]])Dotfiles Version:[[:space:]]*v?$VERSION_PATTERN" \
|
|
427
|
-
-e "Version[[:space:]]*\`v?$VERSION_PATTERN\`" \
|
|
428
|
-
-e "\\(v$VERSION_PATTERN\\)" \
|
|
429
|
-
-e "/v$VERSION_PATTERN/" \
|
|
430
|
-
-e "v$VERSION_PATTERN([^0-9.]|$)" \
|
|
431
|
-
-e "dotfiles:v?$VERSION_PATTERN" \
|
|
432
|
-
-e "notes — v$VERSION_PATTERN" || true
|
|
433
|
-
)
|
|
434
|
-
fi
|
|
435
|
-
|
|
436
|
-
if [[ ${#versions_in_file[@]} -eq 0 ]]; then
|
|
437
|
-
continue
|
|
438
|
-
fi
|
|
439
|
-
|
|
440
|
-
for version in "${versions_in_file[@]}"; do
|
|
441
|
-
# Remove 'v' prefix if present for comparison
|
|
442
|
-
local clean_version="${version#v}"
|
|
443
|
-
if [[ "$clean_version" != "$expected_version" ]]; then
|
|
444
|
-
log_error "Inconsistent version in $file: $version (expected: v$expected_version)"
|
|
445
|
-
inconsistencies=$((inconsistencies + 1))
|
|
446
|
-
fi
|
|
447
|
-
done
|
|
448
|
-
done
|
|
449
|
-
|
|
450
|
-
if [[ $inconsistencies -eq 0 ]]; then
|
|
451
|
-
log_success "All version references are consistent: v$expected_version (checked $total_checked files)"
|
|
452
|
-
return 0
|
|
453
|
-
else
|
|
454
|
-
log_error "Found $inconsistencies inconsistent version references"
|
|
455
|
-
return 1
|
|
456
|
-
fi
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
main() {
|
|
460
|
-
local target_version=""
|
|
461
|
-
local dry_run="false"
|
|
462
|
-
local verify_only="false"
|
|
463
|
-
local create_backup_flag="true"
|
|
464
|
-
local force_sync="false"
|
|
465
|
-
|
|
466
|
-
# Parse arguments
|
|
467
|
-
while [[ $# -gt 0 ]]; do
|
|
468
|
-
case $1 in
|
|
469
|
-
-h | --help)
|
|
470
|
-
show_help
|
|
471
|
-
exit 0
|
|
472
|
-
;;
|
|
473
|
-
-d | --dry-run)
|
|
474
|
-
dry_run="true"
|
|
475
|
-
shift
|
|
476
|
-
;;
|
|
477
|
-
-v | --verify)
|
|
478
|
-
verify_only="true"
|
|
479
|
-
shift
|
|
480
|
-
;;
|
|
481
|
-
-b | --backup)
|
|
482
|
-
create_backup_flag="true"
|
|
483
|
-
shift
|
|
484
|
-
;;
|
|
485
|
-
--no-backup)
|
|
486
|
-
create_backup_flag="false"
|
|
487
|
-
shift
|
|
488
|
-
;;
|
|
489
|
-
-f | --force)
|
|
490
|
-
force_sync="true"
|
|
491
|
-
shift
|
|
492
|
-
;;
|
|
493
|
-
-*)
|
|
494
|
-
log_error "Unknown option: $1"
|
|
495
|
-
show_help
|
|
496
|
-
exit 1
|
|
497
|
-
;;
|
|
498
|
-
*)
|
|
499
|
-
target_version="$1"
|
|
500
|
-
shift
|
|
501
|
-
;;
|
|
502
|
-
esac
|
|
503
|
-
done
|
|
504
|
-
|
|
505
|
-
if [[ -n "${DOTFILES_COV_TMPDIR:-}" && "${DOTFILES_ALLOW_COVERAGE_WRITES:-0}" != "1" ]]; then
|
|
506
|
-
dry_run="true"
|
|
507
|
-
create_backup_flag="false"
|
|
508
|
-
log_info "Coverage sandbox detected; forcing --dry-run"
|
|
509
|
-
fi
|
|
510
|
-
|
|
511
|
-
# Change to project root
|
|
512
|
-
cd "$PROJECT_ROOT"
|
|
513
|
-
|
|
514
|
-
# Determine target version
|
|
515
|
-
if [[ -z "$target_version" ]]; then
|
|
516
|
-
target_version=$(get_package_version)
|
|
517
|
-
log_info "Using package.json version: $target_version"
|
|
518
|
-
else
|
|
519
|
-
validate_version "$target_version"
|
|
520
|
-
log_info "Using specified version: $target_version"
|
|
521
|
-
fi
|
|
522
|
-
|
|
523
|
-
# Find files with version references
|
|
524
|
-
local version_files=()
|
|
525
|
-
local version_file
|
|
526
|
-
while IFS= read -r version_file; do
|
|
527
|
-
version_files+=("$version_file")
|
|
528
|
-
done < <(find_version_files)
|
|
529
|
-
|
|
530
|
-
if [[ ${#version_files[@]} -eq 0 ]]; then
|
|
531
|
-
log_warning "No files with version references found"
|
|
532
|
-
exit 0
|
|
533
|
-
fi
|
|
534
|
-
|
|
535
|
-
log_info "Found ${#version_files[@]} files with version references"
|
|
536
|
-
|
|
537
|
-
# Verify mode - just check consistency
|
|
538
|
-
if [[ "$verify_only" == "true" ]]; then
|
|
539
|
-
if verify_version_consistency "$target_version" "${version_files[@]}"; then
|
|
540
|
-
exit 0
|
|
541
|
-
else
|
|
542
|
-
exit 1
|
|
543
|
-
fi
|
|
544
|
-
fi
|
|
545
|
-
|
|
546
|
-
# Create backup if requested and not dry run
|
|
547
|
-
if [[ "$create_backup_flag" == "true" && "$dry_run" == "false" ]]; then
|
|
548
|
-
create_backup "${version_files[@]}"
|
|
549
|
-
fi
|
|
550
|
-
|
|
551
|
-
# Sync chezmoidata.toml (single source of truth for template files).
|
|
552
|
-
# Post-Phase-4b lives under defaults/ — kept old root location as a
|
|
553
|
-
# fallback so this script is forward- and backward-compatible.
|
|
554
|
-
local chezmoidata="$PROJECT_ROOT/defaults/.chezmoidata.toml"
|
|
555
|
-
[[ -f "$chezmoidata" ]] || chezmoidata="$PROJECT_ROOT/.chezmoidata.toml"
|
|
556
|
-
if [[ -f "$chezmoidata" ]]; then
|
|
557
|
-
if [[ "$dry_run" == "true" ]]; then
|
|
558
|
-
log_info "Would update ${chezmoidata#"$PROJECT_ROOT/"}: dotfiles_version = \"$target_version\""
|
|
559
|
-
else
|
|
560
|
-
sed_in_place "$chezmoidata" \
|
|
561
|
-
"s|^dotfiles_version = \"$SED_VERSION_PATTERN\"|dotfiles_version = \"$target_version\"|"
|
|
562
|
-
log_success "Updated ${chezmoidata#"$PROJECT_ROOT/"}"
|
|
563
|
-
fi
|
|
564
|
-
fi
|
|
565
|
-
|
|
566
|
-
# package.json is the release-tooling source used when VERSION is omitted.
|
|
567
|
-
# A caller-supplied target must update it atomically before downstream
|
|
568
|
-
# verification, otherwise the repository immediately contains two versions.
|
|
569
|
-
local package_json="$PROJECT_ROOT/package.json"
|
|
570
|
-
if [[ "$dry_run" == "true" ]]; then
|
|
571
|
-
log_info "Would update package.json: version = \"$target_version\""
|
|
572
|
-
else
|
|
573
|
-
local package_tmp
|
|
574
|
-
package_tmp=$(umask 077 && mktemp)
|
|
575
|
-
if command -v jq >/dev/null 2>&1; then
|
|
576
|
-
jq --arg version "$target_version" '.version = $version' "$package_json" >"$package_tmp"
|
|
577
|
-
else
|
|
578
|
-
cp "$package_json" "$package_tmp"
|
|
579
|
-
sed_in_place "$package_tmp" "s|\"version\": \"$SED_VERSION_PATTERN\"|\"version\": \"$target_version\"|"
|
|
580
|
-
fi
|
|
581
|
-
cat "$package_tmp" >"$package_json"
|
|
582
|
-
rm -f "$package_tmp"
|
|
583
|
-
log_success "Updated package.json"
|
|
584
|
-
fi
|
|
585
|
-
|
|
586
|
-
# Sync non-template script files that embed the version
|
|
587
|
-
local script_files=(
|
|
588
|
-
"bin/dot"
|
|
589
|
-
"dot_local/bin/executable_tour"
|
|
590
|
-
"install.sh"
|
|
591
|
-
"lib/dot/bento.sh"
|
|
592
|
-
"share/man/man1/dot.1"
|
|
593
|
-
)
|
|
594
|
-
for script_file in "${script_files[@]}"; do
|
|
595
|
-
local full_path="$PROJECT_ROOT/$script_file"
|
|
596
|
-
if [[ -f "$full_path" ]]; then
|
|
597
|
-
local temp_file
|
|
598
|
-
temp_file=$(umask 077 && mktemp)
|
|
599
|
-
cp "$full_path" "$temp_file"
|
|
600
|
-
sed_in_place "$temp_file" "s|v$SED_VERSION_PATTERN|v$target_version|g"
|
|
601
|
-
sed_in_place "$temp_file" "s|\"$SED_VERSION_PATTERN\"|\"$target_version\"|g"
|
|
602
|
-
if ! cmp -s "$full_path" "$temp_file"; then
|
|
603
|
-
if [[ "$dry_run" == "true" ]]; then
|
|
604
|
-
log_info "Would update: $script_file"
|
|
605
|
-
else
|
|
606
|
-
# Use cat to preserve permissions and ownership
|
|
607
|
-
cat "$temp_file" >"$full_path"
|
|
608
|
-
log_success "Updated: $script_file"
|
|
609
|
-
fi
|
|
610
|
-
else
|
|
611
|
-
rm -f "$temp_file"
|
|
612
|
-
fi
|
|
613
|
-
fi
|
|
614
|
-
done
|
|
615
|
-
|
|
616
|
-
# Update version references
|
|
617
|
-
local changes_made
|
|
618
|
-
changes_made="$(update_version_references "$target_version" "$dry_run" "${version_files[@]}")"
|
|
619
|
-
if [[ "$changes_made" =~ ^[0-9]+$ ]]; then
|
|
620
|
-
|
|
621
|
-
if [[ $changes_made -gt 0 || "$force_sync" == "true" ]]; then
|
|
622
|
-
if [[ "$dry_run" == "false" ]]; then
|
|
623
|
-
# Verify the changes
|
|
624
|
-
if verify_version_consistency "$target_version" "${version_files[@]}"; then
|
|
625
|
-
log_success "Version synchronization completed successfully"
|
|
626
|
-
|
|
627
|
-
# Show summary
|
|
628
|
-
cat <<EOF
|
|
629
|
-
|
|
630
|
-
═══════════════════════════════════════
|
|
631
|
-
Version Sync Summary
|
|
632
|
-
═══════════════════════════════════════
|
|
633
|
-
Target Version: v$target_version
|
|
634
|
-
Files Updated: $changes_made
|
|
635
|
-
Backup Created: $create_backup_flag
|
|
636
|
-
Verification: ✅ Passed
|
|
637
|
-
|
|
638
|
-
EOF
|
|
639
|
-
else
|
|
640
|
-
log_error "Version synchronization failed verification"
|
|
641
|
-
exit 1
|
|
642
|
-
fi
|
|
643
|
-
fi
|
|
644
|
-
else
|
|
645
|
-
log_info "No changes needed - all versions are already synchronized"
|
|
646
|
-
fi
|
|
647
|
-
else
|
|
648
|
-
log_error "Version synchronization failed"
|
|
649
|
-
exit 1
|
|
650
|
-
fi
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
# Run main function
|
|
654
|
-
main "$@"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
profile = "desktop"
|
|
2
|
-
host_id = "geekom-a9"
|
|
3
|
-
host_class = "linux-desktop"
|
|
4
|
-
|
|
5
|
-
[features]
|
|
6
|
-
gui = true
|
|
7
|
-
linux_desktop = true
|
|
8
|
-
niri = true
|
|
9
|
-
waybar = true
|
|
10
|
-
fuzzel = true
|
|
11
|
-
mako = true
|
|
12
|
-
foot = true
|
|
13
|
-
kanshi = true
|
|
14
|
-
touch = false
|
|
15
|
-
t2 = false
|
|
16
|
-
surface = false
|
|
17
|
-
|
|
18
|
-
[monitors]
|
|
19
|
-
internal = false
|
|
20
|
-
scale = 1.0
|
|
21
|
-
rotation = "normal"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
profile = "laptop"
|
|
2
|
-
host_id = "mac-m1"
|
|
3
|
-
host_class = "macos"
|
|
4
|
-
|
|
5
|
-
[features]
|
|
6
|
-
gui = true
|
|
7
|
-
linux_desktop = false
|
|
8
|
-
niri = false
|
|
9
|
-
waybar = false
|
|
10
|
-
fuzzel = false
|
|
11
|
-
mako = false
|
|
12
|
-
foot = false
|
|
13
|
-
kanshi = false
|
|
14
|
-
touch = false
|
|
15
|
-
t2 = false
|
|
16
|
-
surface = false
|