openSUSE / jeos-firstboot

Lightweight firstboot wizard systemd service for SLE and openSUSE JeOS Images
MIT License
14 stars 13 forks source link

Make use of shellcheck #95

Closed Vogtinator closed 8 months ago

Vogtinator commented 2 years ago

https://www.shellcheck.net checks bash (and other shell) scripts for errors and possible bugs, we could make use of that for CI. This would probably require quite a few fixes and shellcheck ignores to make it really useful though. Needs some experimenting.

gmoro commented 2 years ago

I tried that before, but had no time to really put it to use, would be a great addition

Vogtinator commented 2 years ago

We should try to use relative source paths for inclusion to fix issues like

In files/usr/sbin/jeos-config line 23:
. "/usr/share/jeos-firstboot/jeos-firstboot-functions"
  ^-- SC1091 (info): Not following: /usr/share/jeos-firstboot/jeos-firstboot-functions was not specified as input (see shellcheck -x).

e.g. in jeos-firstboot and jeos-config do cd "$(dirname $0)" to ensure we're in the right location and then use . ../share/jeos-firstboot/.... That would also make it possible to test without installing it system-wide.