|
1 |
| -#!/bin/bash -e |
| 1 | +#! /usr/bin/env bash |
2 | 2 |
|
3 | 3 | #
|
4 | 4 | # Copyright (c) 2023 Project CHIP Authors
|
@@ -37,6 +37,9 @@ DEVELOPMENT_PATH="/var/credentials/development"
|
37 | 37 |
|
38 | 38 | source "$TH_SCRIPTS_DIR/utils.sh"
|
39 | 39 |
|
| 40 | +# Store the current dir |
| 41 | +CURRENT_DIR=$(pwd) |
| 42 | + |
40 | 43 | print_start_of_script
|
41 | 44 |
|
42 | 45 | # If SDK path is not present, then do local checkout
|
|
46 | 49 | # If SDK SHA is not present, then fetch from Matter program config file
|
47 | 50 | if [ -z "$SDK_SHA" ]
|
48 | 51 | then
|
49 |
| - cd $MATTER_PROGRAM_DIR |
| 52 | + print_script_step "Read SDK_SHA from $MATTER_PROGRAM_DIR/config.py file" |
50 | 53 | SDK_SHA=$(cat $MATTER_PROGRAM_DIR/config.py | grep SDK_SHA | cut -d'"' -f 2 | cut -d"'" -f 2)
|
51 | 54 | fi
|
52 |
| - |
| 55 | + printf "SDK_SHA: $SDK_SHA\n" |
| 56 | + |
53 | 57 | print_script_step "Checkout SDK sparsely"
|
54 | 58 | rm -rf $TMP_SDK_PATH
|
55 | 59 | cd /tmp
|
|
61 | 65 | SDK_PATH="$TMP_SDK_PATH"
|
62 | 66 | fi
|
63 | 67 |
|
| 68 | +printf "\nSDK_PATH: $SDK_PATH\n" |
| 69 | + |
| 70 | +# Back to execution dir |
| 71 | +cd $CURRENT_DIR |
| 72 | + |
64 | 73 | # Create folder if missing (owned by user)
|
65 | 74 | if [ ! -d "$CERT_PATH" ]
|
66 | 75 | then
|
67 |
| - print_script_step "Creating certification folder $CERT_PATH" |
| 76 | + print_script_step "Creating certification folder" |
68 | 77 | sudo mkdir -p $CERT_PATH
|
69 | 78 | sudo chown $USER:$USER $CERT_PATH
|
70 | 79 | fi
|
71 | 80 |
|
72 | 81 | # Create folder if missing (owned by user)
|
73 | 82 | if [ ! -d "$DEVELOPMENT_PATH" ]
|
74 | 83 | then
|
75 |
| - print_script_step "Creating developer certification folder $DEVELOPMENT_PATH" |
| 84 | + print_script_step "Creating developer certification folder" |
76 | 85 | sudo mkdir -p $DEVELOPMENT_PATH
|
77 | 86 | sudo chown $USER:$USER $DEVELOPMENT_PATH
|
78 | 87 | fi
|
79 | 88 |
|
80 | 89 | print_script_step "Copying Certificates from SDK"
|
| 90 | +echo "Running copy command: cp "$SDK_PATH/$SDK_CERT_PATH/"* $CERT_PATH/" |
81 | 91 | cp "$SDK_PATH/$SDK_CERT_PATH/"* $CERT_PATH/
|
82 | 92 |
|
83 | 93 | print_script_step "Copying Developer Certificates from SDK"
|
| 94 | +echo "Running copy command: cp -R "$SDK_PATH/$SDK_CERT_DEVELOPMENT_PATH/"** $DEVELOPMENT_PATH/" |
84 | 95 | cp -R "$SDK_PATH/$SDK_CERT_DEVELOPMENT_PATH/"** $DEVELOPMENT_PATH/
|
85 | 96 |
|
86 | 97 | print_end_of_script
|
0 commit comments