Make dotfiles compatible with gitpod style dotfiles
Add an install.sh that attempts to determine the OS, install stow and then call my apply-dotfiles script to use stow. The old installation process that was based on nix, has been moved to nix-install.
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -p stow -i bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
stow bash
|
||||
stow sh
|
||||
stow readline
|
||||
apply_dotfile() {
|
||||
directory_to_stow="${1}"
|
||||
stow --adopt -S -t "${HOME}" "${directory_to_stow}"
|
||||
}
|
||||
|
||||
stow vim
|
||||
# Adopt will change the files in stow to match existing files.
|
||||
# We don't want this, we just want to handle existing files gracefully.
|
||||
# We simply adopt all the files and then at the end restore our git repo to undo changes
|
||||
restore_from_adoption() {
|
||||
git restore .
|
||||
}
|
||||
|
||||
stow ruby
|
||||
stow python
|
||||
apply_dotfile bash
|
||||
apply_dotfile sh
|
||||
apply_dotfile readline
|
||||
|
||||
stow ssh
|
||||
apply_dotfile vim
|
||||
|
||||
apply_dotfile ruby
|
||||
apply_dotfile python
|
||||
|
||||
apply_dotfile ssh
|
||||
|
||||
restore_from_adoption
|
||||
|
||||
Reference in New Issue
Block a user