Skip to content

Commit

Permalink
move bash flag to set statement (opensearch-project#3494)
Browse files Browse the repository at this point in the history
Passing bash with flags to the first argument of /usr/bin/env requires
its own flag to interpret it correctly.  Rather than use `env -S` to
split the argument, have the script `set -e` to enable the same behavior
explicitly in preinst and postinst scripts.

Also set `-o pipefail` for consistency.

Closes: opensearch-project#3492

Signed-off-by: Cole White <cwhite@wikimedia.org>
  • Loading branch information
shdubsh authored and Bukhtawar committed Jun 21, 2022
1 parent 2564cab commit e10aadc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion buildSrc/src/main/resources/deb/postinst.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash -e
#!/usr/bin/env bash
set -e -o pipefail
<% commands.each {command -> %><%= command %><% } %>
3 changes: 2 additions & 1 deletion buildSrc/src/main/resources/deb/preinst.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash -e
#!/usr/bin/env bash
set -e -o pipefail
<% commands.each {command -> %><%= command %><% } %>

0 comments on commit e10aadc

Please sign in to comment.