Skip to content

Commit 792918f

Browse files
committed
Improve logs
1 parent a2dd8b6 commit 792918f

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

test_collections/matter/scripts/update-paa-certs.sh

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -e
1+
#! /usr/bin/env bash
22

33
#
44
# Copyright (c) 2023 Project CHIP Authors
@@ -37,6 +37,9 @@ DEVELOPMENT_PATH="/var/credentials/development"
3737

3838
source "$TH_SCRIPTS_DIR/utils.sh"
3939

40+
# Store the current dir
41+
CURRENT_DIR=$(pwd)
42+
4043
print_start_of_script
4144

4245
# If SDK path is not present, then do local checkout
@@ -46,10 +49,11 @@ then
4649
# If SDK SHA is not present, then fetch from Matter program config file
4750
if [ -z "$SDK_SHA" ]
4851
then
49-
cd $MATTER_PROGRAM_DIR
52+
print_script_step "Read SDK_SHA from $MATTER_PROGRAM_DIR/config.py file"
5053
SDK_SHA=$(cat $MATTER_PROGRAM_DIR/config.py | grep SDK_SHA | cut -d'"' -f 2 | cut -d"'" -f 2)
5154
fi
52-
55+
printf "SDK_SHA: $SDK_SHA\n"
56+
5357
print_script_step "Checkout SDK sparsely"
5458
rm -rf $TMP_SDK_PATH
5559
cd /tmp
@@ -61,26 +65,33 @@ then
6165
SDK_PATH="$TMP_SDK_PATH"
6266
fi
6367

68+
printf "\nSDK_PATH: $SDK_PATH\n"
69+
70+
# Back to execution dir
71+
cd $CURRENT_DIR
72+
6473
# Create folder if missing (owned by user)
6574
if [ ! -d "$CERT_PATH" ]
6675
then
67-
print_script_step "Creating certification folder $CERT_PATH"
76+
print_script_step "Creating certification folder"
6877
sudo mkdir -p $CERT_PATH
6978
sudo chown $USER:$USER $CERT_PATH
7079
fi
7180

7281
# Create folder if missing (owned by user)
7382
if [ ! -d "$DEVELOPMENT_PATH" ]
7483
then
75-
print_script_step "Creating developer certification folder $DEVELOPMENT_PATH"
84+
print_script_step "Creating developer certification folder"
7685
sudo mkdir -p $DEVELOPMENT_PATH
7786
sudo chown $USER:$USER $DEVELOPMENT_PATH
7887
fi
7988

8089
print_script_step "Copying Certificates from SDK"
90+
echo "Running copy command: cp "$SDK_PATH/$SDK_CERT_PATH/"* $CERT_PATH/"
8191
cp "$SDK_PATH/$SDK_CERT_PATH/"* $CERT_PATH/
8292

8393
print_script_step "Copying Developer Certificates from SDK"
94+
echo "Running copy command: cp -R "$SDK_PATH/$SDK_CERT_DEVELOPMENT_PATH/"** $DEVELOPMENT_PATH/"
8495
cp -R "$SDK_PATH/$SDK_CERT_DEVELOPMENT_PATH/"** $DEVELOPMENT_PATH/
8596

8697
print_end_of_script

0 commit comments

Comments
 (0)