Skip to content

Commit

Permalink
fix: Switch from !include to !import
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Dec 26, 2023
1 parent 217a917 commit b6ab2b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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 '\!include \/usr\/share\/ublue-os\/justfile/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
2 changes: 1 addition & 1 deletion build/ublue-os-just/ublue-os-just.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}

# Create justfile which contains all .just files included in this package
for justfile in %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name}/*.just; do
echo "!include %{_datadir}/%{VENDOR}/%{sub_name}/$(basename ${justfile})" >> "%{buildroot}%{_datadir}/%{VENDOR}/justfile"
echo "!import %{_datadir}/%{VENDOR}/%{sub_name}/$(basename ${justfile})" >> "%{buildroot}%{_datadir}/%{VENDOR}/justfile"
done

# Add global "ujust" script to run just with --unstable
Expand Down

0 comments on commit b6ab2b8

Please sign in to comment.