Skip to content

Commit

Permalink
Suppress output of cd when echoing path (#31445)
Browse files Browse the repository at this point in the history
The `cd` command prints the destination path in case when CDPATH
has been modified by user.
  • Loading branch information
arkq authored Jan 16, 2024
1 parent 72fd9e9 commit 71f6a62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions scripts/tools/zap/run_zaptool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

function _get_fullpath() {
cd "$(dirname "$1")" && echo "$PWD/$(basename "$1")"
cd "$(dirname "$1")" >/dev/null && echo "$PWD/$(basename "$1")"
}

set -e
Expand All @@ -35,14 +35,14 @@ if [[ -z "$ZAP_INSTALL_PATH" && -n "$PW_ZAP_CIPD_INSTALL_DIR" ]]; then
ZAP_INSTALL_PATH="$PW_ZAP_CIPD_INSTALL_DIR"
fi

if [ ! -z "$ZAP_DEVELOPMENT_PATH" ]; then
if [ -n "$ZAP_DEVELOPMENT_PATH" ]; then
WORKING_DIR=$ZAP_DEVELOPMENT_PATH
ZAP_CMD="node src-script/zap-start.js"
# Make sure we don't try to munge the package.json in the ZAP repo.
export ZAP_SKIP_REAL_VERSION=1

"$CHIP_ROOT"/scripts/tools/zap/zap_bootstrap.sh
elif [ ! -z "$ZAP_INSTALL_PATH" ]; then
elif [ -n "$ZAP_INSTALL_PATH" ]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
ZAP_CMD="$ZAP_INSTALL_PATH/zap.app/Contents/MacOS/zap"
else
Expand All @@ -59,7 +59,7 @@ fi

echo "ARGS: $ZAP_ARGS"

if [[ "${ZAP_ARGS[@]}" == *"/all-clusters-app.zap"* ]]; then
if [[ "${ZAP_ARGS[*]}" == *"/all-clusters-app.zap"* ]]; then
ZCL_FILE="$CHIP_ROOT/src/app/zap-templates/zcl/zcl-with-test-extensions.json"
else
ZCL_FILE="$CHIP_ROOT/src/app/zap-templates/zcl/zcl.json"
Expand Down
4 changes: 0 additions & 4 deletions scripts/tools/zap/zap_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
# limitations under the License.
#

function _get_fullpath() {
cd "$(dirname "$1")" && echo "$PWD/$(basename "$1")"
}

function _usage() {
cat <<EOF
Invalid arguments passed.
Expand Down

0 comments on commit 71f6a62

Please sign in to comment.