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: Use import for just #179

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ jobs:
registry: ${{ steps.registry_case.outputs.lowercase }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
extra-args: |
--disable-content-trust

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
2 changes: 1 addition & 1 deletion build/ublue-os-just/00-default.just
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set allow-duplicate-recipes := true
set ignore-comments := true

_default:
@just --unstable --list --list-heading $'Available commands:\n' --list-prefix $' - '
@just --list --list-heading $'Available commands:\n' --list-prefix $' - '

# Boot into this device's BIOS/UEFI screen
bios:
Expand Down
9 changes: 4 additions & 5 deletions build/ublue-os-just/ublue-os-just.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
alias just="just --unstable"

# Add uBlue's justfiles to users with home directories which lack a justfile.

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\/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