Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(just): separate just and ujust #353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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