Skip to content

Commit

Permalink
fix: separate just and ujust
Browse files Browse the repository at this point in the history
  • Loading branch information
Danar435 committed Jan 16, 2025
1 parent f7a6716 commit 705c0df
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions build/ublue-os-just/etc-profile.d/ublue-os-just.sh
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

0 comments on commit 705c0df

Please sign in to comment.