Justfile/rebuild-this-device: rename device -> devicename

This commit is contained in:
steveej 2021-02-07 17:00:41 +01:00
parent 7dda7653b8
commit ffc9bb9fec

View file

@ -84,12 +84,12 @@ rebuild-this-device rebuildarg="dry-activate":
fi fi
# Re-render the versions of a remote device and rebuild its environment # Re-render the versions of a remote device and rebuild its environment
update-remote-device device target rebuildmode='switch': update-remote-device devicename target rebuildmode='switch':
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
template=nix/os/devices/{{device}}/versions.tmpl.nix template=nix/os/devices/{{ devicename }}/versions.tmpl.nix
outfile=nix/os/devices/{{device}}/versions.nix outfile=nix/os/devices/{{ devicename }}/versions.nix
if ! test -e ${template}; then if ! test -e ${template}; then
template="$(just _DEFAULT_VERSION_TMPL)" template="$(just _DEFAULT_VERSION_TMPL)"
@ -101,17 +101,17 @@ update-remote-device device target rebuildmode='switch':
exit 0 exit 0
fi fi
just -v rebuild-remote-device {{device}} {{target}} dry-activate || { just -v rebuild-remote-device {{ devicename }} {{target}} dry-activate || {
echo ERROR: rebuild in mode 'dry-active' failed after updating ${outfile} echo ERROR: rebuild in mode 'dry-active' failed after updating ${outfile}
exit 1 exit 1
} }
just -v rebuild-remote-device {{ device }} {{ target }} {{ rebuildmode }} || { just -v rebuild-remote-device {{ devicename }} {{ target }} {{ rebuildmode }} || {
echo ERROR: rebuild in mode '{{ rebuildmode }}' failed after updating ${outfile} echo ERROR: rebuild in mode '{{ rebuildmode }}' failed after updating ${outfile}
exit 1 exit 1
} }
git commit -v ${outfile} -m "nix/os/devices/{{ device }}: bump versions" git commit -v ${outfile} -m "nix/os/devices/{{ devicename }}: bump versions"
# Re-render the versions of the current device and rebuild its environment # Re-render the versions of the current device and rebuild its environment
update-this-device rebuild-mode='switch': update-this-device rebuild-mode='switch':