Skip to content

Commit

Permalink
fix: Move default to it's own file which gets included as the beginni…
Browse files Browse the repository at this point in the history
…ng of the merged justfile
  • Loading branch information
KyleGospo committed Jan 4, 2024
1 parent d1a0c9d commit ef8287f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions build/ublue-os-just/00-default.just
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ shell := `grep :$(id -u): /etc/passwd | cut -d: -f7`
set allow-duplicate-recipes := true
set ignore-comments := true

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

# Boot into this device's BIOS/UEFI screen
bios:
systemctl reboot --firmware-setup
Expand Down
2 changes: 2 additions & 0 deletions build/ublue-os-just/header.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_default:
@just --list --list-heading $'Available commands:\n' --list-prefix $' - '
3 changes: 3 additions & 0 deletions build/ublue-os-just/ublue-os-just.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Source7: 60-custom.just
Source8: 70-nix.just
Source9: ujust
Source10: ugum
Source11: header.just

%global sub_name %{lua:t=string.gsub(rpm.expand("%{NAME}"), "^ublue%-os%-", ""); print(t)}

Expand All @@ -37,6 +38,8 @@ install -Dm755 %{SOURCE0} %{buildroot}%{_sysconfdir}/profile.d/ublue-os-just.sh
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name}

# Create justfile which contains all .just files included in this package
# Apply header first due to default not working in included justfiles
cat %{SOURCE11} >> "%{buildroot}%{_datadir}/%{VENDOR}/justfile"
for justfile in %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name}/*.just; do
echo "import \"%{_datadir}/%{VENDOR}/%{sub_name}/$(basename ${justfile})\"" >> "%{buildroot}%{_datadir}/%{VENDOR}/justfile"
done
Expand Down

0 comments on commit ef8287f

Please sign in to comment.