Skip to content

Commit

Permalink
Ensure an if-then-else doesn't have an empty if block
Browse files Browse the repository at this point in the history
Issue #1749
  • Loading branch information
jordansissel committed Jun 17, 2021
1 parent 2a6facb commit 72a925b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions templates/deb/postinst_upgrade.sh.erb
Expand Up @@ -20,6 +20,7 @@ debsystemctl=$(command -v deb-systemd-invoke || echo systemctl)
<% attributes[:deb_systemd].each do |service| -%>
if ! systemctl is-enabled <%= service %> >/dev/null
then
: # Ensure this if-clause is not empty. If it were empty, and we had an 'else', then it is an error in shell syntax
<% if attributes[:deb_systemd_enable?]-%>
systemctl enable <%= service %> >/dev/null || true
<% end -%>
Expand Down

0 comments on commit 72a925b

Please sign in to comment.