Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-2501

installApp generated shell script is too verbose when performing internal cd

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3-rc-1

      Description

      If the environment variable CDPATH is set any call to the bash internal "cd" will print the new path to standard out if the argument was called with a relative path (to make the user aware of the final directory where he has "cded" to).

      This is the case for the generated shell script from the installApp plugin. When calling the generated script by, e.g. "build/install/xxxtool/bin/xxxtool" the first thing it does, is printing something like "/Users/ascheman/wrk/xxxtool/build/install/xxxtool" which is not expected by the user.

      This can be fixed by changing the following line in the generated shell script

      cd "`dirname \"$PRG\"`/.."

      to

      cd "`dirname \"$PRG\"`/.." >&-

      to make it print the message to /dev/null.

      (This is a common error which can be seen in a lot of bash scripts since only few people are aware of the "cd" command behaviour when the convenience variable CDPATH is set).

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            ascheman Gerd Aschemann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: