dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

bootstrap.sh bug: if bootstrap pulls a new bootstrap, syncing continues with old bootstrap -> bad things happen

Open gangelop opened this issue 11 years ago • 2 comments

Previously, if bootstrap.sh had been changed in the origin repo, the syncing would continue using the old bootstrap.sh. This can cause problems such as the following: Say you have added a new LICENSE file and an appropriate exclusion in the rsync of bootstraph.sh. When a user does source bootstrap.sh the new LICENSE file and bootstrap.sh file get pulled but the syncing continues with the old bootstrap which doesn't have the exclusion, thus giving you a LICENSE file in your ~. This commit gives a basic solution of exiting if the bootstrap.sh file has changed after the git pull.

Ideally, this could be automated because there isn't any real reason the user should be bothered. I just wasn't sure how to implement it.

I have an idea.

gangelop avatar May 21 '13 21:05 gangelop

There's a small issue with my code because $BASH_SOURCE gives the relative path which is useless after the cd. Not sure how to write this yet. It could be hardcoded with the name of the script but that's just lazy.

EDIT: so there's this command called basename.... Commit incoming.

gangelop avatar May 22 '13 12:05 gangelop

As far as I'm concerned, this code is ready. It will require user intervention in case of a new bootstrap.sh file, but it's better than bootstrapping a current repo with an non-current bootstrap.

gangelop avatar Jun 18 '13 10:06 gangelop