forked from thoughtbot/rcm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for XDG compliant directories and configuration
This change the default of : - ~/.rcrc with ~/.dotfiles to - ~/.config/rcm/rcrc with ~/.local/share/rcm/dotfiles (XDG_xxxx) It's an _hard_ error to have both ~/.rcrc and ~/.config/rcm/rcrc, except for _compatibility_ to keep ~/.rcrc as a link to ~/.config/rcm/rcrc Completes thoughtbot#250
- Loading branch information
jonathan 'jonthn' buschmann
committed
May 8, 2023
1 parent
ef34b0b
commit 653c89c
Showing
17 changed files
with
156 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
rcm (@PACKAGE_VERSION@) unstable; urgency=low | ||
|
||
* Feature: rcup/rcdn hooks can bail early (Patrick Brisbin) | ||
* Feature: XDG-compliance ~/.config/rcm/rcrc and ~/local/share/rcm/dotfiles | ||
* Documentation improvement (Teo Ljungberg) | ||
|
||
-- Mike Burns <[email protected]> Fri, 30 Dec 2022 11:43:00 -0500 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
$ unset RCRC | ||
$ unset XDG_CONFIG_HOME | ||
$ unset XDG_DATA_HOME | ||
|
||
Should allow when ~/.rcrc is a symlink to ~/.config/rcm/rcrc | ||
|
||
$ mkdir -p ~/.config/rcm | ||
$ touch ~/.config/rcm/rcrc | ||
$ ln -s ~/.config/rcm/rcrc ~/.rcrc | ||
$ rcup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
$ unset RCRC | ||
$ unset XDG_CONFIG_HOME | ||
$ unset XDG_DATA_HOME | ||
|
||
Should support ~/.config/rcm/rcrc with ~/.dotfiles | ||
|
||
$ mkdir -p ~/.config/rcm | ||
$ touch ~/.config/rcm/rcrc | ||
$ mkdir -p .dotfiles | ||
> mkdir -p ".dotfiles/config/software2/" | ||
> touch ".dotfiles/config/software2/foobar" | ||
|
||
$ rcup | ||
> assert_linked "$HOME/.config/software2/foobar" "$HOME/.dotfiles/config/software2/foobar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
$ unset RCRC | ||
$ unset XDG_CONFIG_HOME | ||
$ unset XDG_DATA_HOME | ||
|
||
Should exit when using both ~/.rcrc and ~/.config/rcm/rcrc | ||
|
||
$ mkdir -p ~/.config/rcm | ||
$ touch ~/.config/rcm/rcrc | ||
$ touch ~/.rcrc | ||
$ rcup | ||
Both \/[\/\d\w_.-]+\.rcrc and \/[\/\d\w_.-]+\.config\/rcm\/rcrc exists\. Please remove one to use rcm (re) | ||
[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
$ unset RCRC | ||
$ unset XDG_CONFIG_HOME | ||
$ unset XDG_DATA_HOME | ||
|
||
Should prefer ~/.local/share/rcm/dotfiles over ~/.dotfiles | ||
|
||
$ mkdir -p .dotfiles | ||
> mkdir -p .dotfiles/config/software3/ | ||
> touch ".dotfiles/config/software3/traditional-config" | ||
$ mkdir -p .local/share/rcm/dotfiles | ||
> mkdir -p .local/share/rcm/dotfiles/config/software3 | ||
> touch ".local/share/rcm/dotfiles/config/software3/xdg-config" | ||
|
||
$ rcup | ||
> assert_linked "$HOME/.config/software3/xdg-config" "$HOME/.local/share/rcm/dotfiles/config/software3/xdg-config" | ||
> refute "used ~/.dotfiles" -r $HOME/.config/software3/traditional-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
$ unset RCRC | ||
$ unset XDG_CONFIG_HOME | ||
$ unset XDG_DATA_HOME | ||
|
||
Should support complete XDG-style directories and configuration | ||
|
||
$ mkdir -p .local/share/rcm/dotfiles | ||
> mkdir -p ".local/share/rcm/dotfiles/config" | ||
> mkdir -p ".local/share/rcm/dotfiles/config/software1" | ||
> mkdir -p ".local/share/rcm/dotfiles/config/software4" | ||
> touch ".local/share/rcm/dotfiles/config/software1/config" | ||
> touch ".local/share/rcm/dotfiles/config/software4/config" | ||
> touch ".local/share/rcm/dotfiles/config/software4/more" | ||
|
||
$ rcup | ||
> assert_linked "$HOME/.config/software1/config" "$HOME/.local/share/rcm/dotfiles/config/software1/config" | ||
> assert_linked "$HOME/.config/software4/config" "$HOME/.local/share/rcm/dotfiles/config/software4/config" | ||
> assert_linked "$HOME/.config/software4/more" "$HOME/.local/share/rcm/dotfiles/config/software4/more" |