generated from ublue-os/udev-rules
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
# Add uBlue's justfiles to users with home directories which lack a justfile. | ||
# Add a custom justfile to users with home directories which lack a justfile. | ||
|
||
if [ ! -z "$HOME" ] && [ -d "$HOME" ] && [ ! -f "${HOME}/.justfile" ]; then | ||
cat > "${HOME}/.justfile" << EOF | ||
import "/usr/share/ublue-os/justfile" | ||
EOF | ||
fi | ||
# You can add your own commands here! | ||
# These commands are separate from the ujust commands. | ||
# Learn more about just at https://github.com/casey/just | ||
if [ -f "${HOME}/.justfile" ]; then | ||
if ! grep -Fxq 'import "/usr/share/ublue-os/justfile"' "${HOME}/.justfile"; then | ||
# Remove any lines we may have added previously. | ||
sed -i '/!include \/usr\/share\/ublue-os\/just\/.*.just/d' "${HOME}/.justfile" | ||
sed -i '/!include \/usr\/share\/ublue-os\/justfile/d' "${HOME}/.justfile" | ||
# Choose | ||
_default: | ||
just --choose | ||
# Point to the new main justfile, place it as the first line | ||
echo '# You can add your own commands here! For documentation, see: https://ublue.it/guide/just/' | tee -a "${HOME}/.justfile" | ||
echo 'import "/usr/share/ublue-os/justfile"' | tee -a "${HOME}/.justfile" | ||
fi | ||
# Edit the justfile | ||
edit: | ||
just -e | ||
EOF | ||
fi |