Skip to content

Commit

Permalink
chore: Use import in ublue-os-just.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo authored Dec 26, 2023
1 parent 6fd3de3 commit 5829f1e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build/ublue-os-just/ublue-os-just.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ alias just="just --unstable"

if [ ! -z "$HOME" ] && [ -d "$HOME" ] && [ ! -f "${HOME}/.justfile" ]; then
cat > "${HOME}/.justfile" << EOF
!include /usr/share/ublue-os/justfile
import /usr/share/ublue-os/justfile
EOF
fi

if [ -f "${HOME}/.justfile" ]; then
if ! grep -Fxq '!include /usr/share/ublue-os/justfile' "${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\/just\/.*.just/d' "${HOME}/.justfile"
sed -i 'import \/usr\/share\/ublue-os\/just\/.*.just/d' "${HOME}/.justfile"

# 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 '!include /usr/share/ublue-os/justfile' | tee -a "${HOME}/.justfile"
echo 'import /usr/share/ublue-os/justfile' | tee -a "${HOME}/.justfile"
fi
fi

0 comments on commit 5829f1e

Please sign in to comment.