Skip to content

Add automated dotfiles deployment scripts#19

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/implement-dotfiles-deployment
Draft

Add automated dotfiles deployment scripts#19
Copilot wants to merge 5 commits intomainfrom
copilot/implement-dotfiles-deployment

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 8, 2025

Manual copying and syncing of dotfiles between repository and machines is time-consuming and error-prone.

Changes

deploy.sh - Symlinks repository dotfiles to $HOME:

  • Backs up existing files with timestamps (file.backup.YYYYMMDD_HHMMSS)
  • Idempotent operations (safe to re-run)
  • Dry-run mode (--dry-run)
  • Handles .profile, .zshrc, .vim/, and .config/*/ subdirectories

uninstall.sh - Removes deployed symlinks:

  • Only removes symlinks pointing to this repository
  • Optional backup restoration (--restore)
  • Cross-platform stat detection (GNU/BSD)
  • Dry-run mode (--dry-run)

README.md - Added installation and usage documentation

Example Usage

# Deploy dotfiles
./deploy.sh

# Preview changes first
./deploy.sh --dry-run

# Remove symlinks and restore originals
./uninstall.sh --restore

Both scripts pass shellcheck validation and handle edge cases (existing files, broken symlinks, permission errors).

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement automated dotfiles deployment</issue_title>
<issue_description>I spend a lot of time copying files from the repository to my machines and synching $HOME with the repo again. Ideally, I should just use a simple script for such job.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 8, 2025 08:28
- Add deploy.sh script with symlink creation and backup functionality
- Add uninstall.sh script to remove symlinks and restore backups
- Update README.md with installation and usage instructions
- Support for dry-run mode in both scripts
- Automatic backup of existing files before creating symlinks

Co-authored-by: kirillbobyrev <[email protected]>
- Add error handling for symlink creation in deploy.sh
- Add error handling for symlink removal in uninstall.sh
- Fix quoting issue in backup pattern variable
- Suppress stderr for cleaner output on expected failures

Co-authored-by: kirillbobyrev <[email protected]>
- Separate variable declarations from assignments (SC2155)
- Replace ls with find for better handling of filenames (SC2012)
- Remove unused backup_pattern variable
- All shellcheck warnings resolved

Co-authored-by: kirillbobyrev <[email protected]>
- Use stat command detection to choose GNU or BSD variant
- Support both GNU stat (Linux) and BSD stat (macOS)
- Ensures backup restoration works on all platforms
- Maintains shellcheck compliance

Co-authored-by: kirillbobyrev <[email protected]>
Copilot AI changed the title [WIP] Implement automated deployment of dotfiles Add automated dotfiles deployment scripts Dec 8, 2025
Copilot AI requested a review from kirillbobyrev December 8, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement automated dotfiles deployment

2 participants