You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/09/02 18:04:23 UTC

[GitHub] [incubator-daffodil] tuxji commented on a change in pull request #413: Various cleanups to sbt rpm configuration

tuxji commented on a change in pull request #413:
URL: https://github.com/apache/incubator-daffodil/pull/413#discussion_r482263253



##########
File path: daffodil-cli/src/templates/bash-template
##########
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh

Review comment:
       Bummer that you have to replace `#!/bin/sh` with `#!/usr/bin/env sh` to avoid rpmbuild changing your shebang (<https://unix.stackexchange.com/questions/588244/rpm-build-modifying-sh-files>).  Life is easier if `#!/bin/sh` just keeps working universally everywhere, even though you're restricted to plain POSIX shell syntax in that case (<https://unix.stackexchange.com/questions/496505/is-it-correct-to-use-bin-sh-in-the-hashbang-if-the-bourne-shell-isnt-available>).
   
   However, I notice this file has the name "bash-template".  You might want to change the name to "sh-template" or change the shebang to `#!/usr/bin/env bash` so that the file's name matches its shebang.  I also ran `shellcheck bash-template` and got a few warnings about corner cases which you may want to fix too.
   
   ```text
   In bash-template line 42:
       cd "$(dirname "$LNK")"
       ^--------------------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
   
   Did you mean: 
       cd "$(dirname "$LNK")" || exit
   
   
   In bash-template line 47:
     cd "$THISPWD"
     ^-----------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
   
   Did you mean: 
     cd "$THISPWD" || exit
   
   
   In bash-template line 53:
   BINDIR=`dirname ${SCRIPT}`		# Directory script is run in
          ^-----------------^ SC2006: Use $(...) notation instead of legacy backticked `...`.
                   ^-------^ SC2086: Double quote to prevent globbing and word splitting.
   
   Did you mean: 
   BINDIR=$(dirname "${SCRIPT}")		# Directory script is run in
   
   
   In bash-template line 77:
   exec java $JOPTS -cp "$CLASSPATH" "$MAINCLASS" "$@"
             ^----^ SC2086: Double quote to prevent globbing and word splitting.
   
   Did you mean: 
   exec java "$JOPTS" -cp "$CLASSPATH" "$MAINCLASS" "$@"
   
   For more information:
     https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |...
     https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
     https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le...
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org