You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t
- **Consistent ordering**: Maintain the same section order across all scripts
878
+
- **Clear boundaries**: Use separator lines (`# ----...`) between major sections
879
+
880
+
### Script Development Workflow
881
+
882
+
When creating or modifying shell scripts, follow this workflow to ensure code quality and documentation consistency:
883
+
884
+
1. **Create/Modify Script**: Make changes to the script in`scripts/vortex/` or `scripts/custom/`
885
+
2. **Lint Scripts**: Run `ahoy lint-scripts` from the `.vortex/` directory to check shell script quality
886
+
3. **Update Documentation**: Run `ahoy update-docs` from the `.vortex/` directory to regenerate documentation from script variables
887
+
4. **Lint Documentation**: Run `ahoy lint-docs` from the `.vortex/` directory to ensure documentation formatting is correct
888
+
5. **Lint Markdown Files**: Run `ahoy lint-markdown` from the `.vortex/` directory to check all markdown files for formatting issues
889
+
890
+
**Example Workflow**:
891
+
892
+
```bash
893
+
# After modifying a script, navigate to .vortex directory
894
+
cd .vortex
895
+
896
+
# Run the quality checks
897
+
ahoy lint-scripts # Lint all shell scripts
898
+
ahoy update-docs # Update documentation from script variables
899
+
ahoy lint-docs # Lint documentation files
900
+
ahoy lint-markdown # Lint markdown files (or use ahoy lint-markdown-fix to auto-fix)
901
+
```
902
+
903
+
**Important Notes**:
904
+
905
+
- **Commands must be run from `.vortex/` directory**: All commands (`lint-scripts`, `update-docs`, `lint-docs`, `lint-markdown`) must be executed from the `.vortex/` directory
906
+
- **Scripts must be linted** before committing to ensure they follow shell script best practices
907
+
- **Documentation must be updated** whenever script variables or structure changes
908
+
- **Documentation must be linted** to maintain consistent formatting across all docs
909
+
- **Markdown auto-fix available**: Use `ahoy lint-markdown-fix` to automatically fix markdown formatting issues
**Implication**: Scripts with interactive modes can be safely tested without hanging, because the test mocks prevent actual execution.
935
+
936
+
### Simplicity Over Complexity
937
+
938
+
**Lesson**: When implementing new features, start with the simplest solution that works.
939
+
940
+
**Example from `update-vortex.sh`**:
941
+
942
+
- ✅ **Simple**: Two conditional branches with explicit commands
943
+
- ❌ **Complex**: Array building, argument iteration, dynamic construction
944
+
945
+
**Why Simpler is Better**:
946
+
947
+
- Easier to read and understand
948
+
- More predictable behavior
949
+
- Better test alignment (argument order is explicit)
950
+
- Fewer edge cases to handle
951
+
- Faster debugging when issues occur
952
+
953
+
**When to Use Complexity**: Only when you need to handle many permutations or truly dynamic argument sets. For simple binary choices (interactive vs non-interactive), conditional execution is clearer.
0 commit comments