Skip to content

Exit with error code #1

Description

@rbioteau

Currently, when a command fails, the program exit with a success status (0)

> java -jar code_sign_tool-1.3.0.jar get_credentials_ids -username=unknown -password=unknown
Error: The provided authorization grant is invalid...
> echo $?
0

Using an error code would prevent false positive build, when the script is integrated in a build pipeline.

In addition the provided CodeSignTool.sh script should have a proper shebang and fail on errors propely like below

#!/bin/bash
set -e

if [[ -z "${CODE_SIGN_TOOL_PATH}" ]]; then
  java -jar ./jar/code_sign_tool-1.3.0.jar $@
else
  java -jar ${CODE_SIGN_TOOL_PATH}/jar/code_sign_tool-1.3.0.jar $@
fi

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions