Skip to content

Commit

Permalink
fix: Use import for just (#179)
Browse files Browse the repository at this point in the history
* fix: Switch from !include to !import

* Remove all just --unstable references (except ujust)

* Remove flag disabling content trust

---------

Co-authored-by: Robert Sturla <[email protected]>
  • Loading branch information
KyleGospo and p5 authored Jan 4, 2024
1 parent 217a917 commit de4e904
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
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

0 comments on commit de4e904

Please sign in to comment.