12 Commits

Author SHA1 Message Date
Yar Kravtsov
4a275ce4ca feat(cmd): add 'list' command to display managed files
Implements a new 'list' command that shows all files and directories managed by lnk, improving visibility and user experience.

fixes #4
2025-05-26 05:59:33 +03:00
Yar Kravtsov
84c507828d fix(status): detect and report uncommitted changes in repository status, fixes #5 2025-05-25 07:35:16 +03:00
Yar Kravtsov
f96bfb6ce0 fix: prevent file loss when multiple files have same basename
Fixes #2: https://github.com/yarlson/lnk/issues/2

Previously, files with the same basename (e.g., a/config.json and b/config.json)
would overwrite each other in the repository, causing data loss. The second file
would completely replace the first, and removing files would fail with 'no such
file or directory' errors.

Changes:
- Store files using unique names based on full relative paths (slashes → underscores)
- Track full relative paths in .lnk file instead of just basenames
- Generate repository names from relative paths to prevent collisions
- Update symlink restoration to work with new path-based system
- Add comprehensive tests for basename collision scenarios

This ensures each file maintains its unique content and can be managed
independently, eliminating the data loss issue.
2025-05-24 18:10:20 +03:00
Yar Kravtsov
09d67f181e refactor(tests): reorganize test files for improved structure and modularity 2025-05-24 11:35:40 +03:00
Yar Kravtsov
3a34e4fb37 refactor(cmd): centralize output formatting with printf helper function 2025-05-24 11:30:55 +03:00
Yar Kravtsov
fc0b567e9f refactor(cmd): improve testability and error handling in CLI commands 2025-05-24 11:28:16 +03:00
Yar Kravtsov
61a9cc8c88 feat: enhance CLI output with colorful and informative messages 2025-05-24 10:13:00 +03:00
Yar Kravtsov
398d011270 feat: implement CI/CD pipeline and release automation 2025-05-24 09:20:43 +03:00
Yar Kravtsov
905d88e0cf feat: simplify README and improve init command 2025-05-24 08:52:27 +03:00
Yar Kravtsov
88b3fbd238 feat: implement phase 1 sync functionality
- Add lnk status command to show repository sync status

- Add lnk push command for smart staging, committing, and pushing

- Add lnk pull command with automatic symlink restoration

- Add comprehensive sync functionality to git and core packages

- Add 5 new integration tests for sync commands (17 total tests)

- Update README with sync workflow examples and documentation

- Support commits ahead/behind tracking relative to remote

- Implement change detection to avoid empty commits

- Add graceful error handling for missing remotes

Closes: Phase 1 sync implementation
2025-05-24 07:20:49 +03:00
Yar Kravtsov
f640d6d11e feat: add --remote flag to init command for adding origin remote 2025-05-24 06:26:43 +03:00
Yar Kravtsov
9088bbda50 feat: initial Lnk CLI implementation 2025-05-24 06:17:52 +03:00