Skip to content

Commit fa96139

Browse files
committed
Updated cert/env update script.
1 parent d783a2d commit fa96139

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

3-
curl https://raw.githubusercontent.com/CogStack/CogStack-NiFi/refs/heads/main/deploy/general.env > ./env/general.env
4-
curl https://raw.githubusercontent.com/CogStack/CogStack-NiFi/refs/heads/main/security/root-ca.key > ./security/root-ca.key
5-
curl https://raw.githubusercontent.com/CogStack/CogStack-NiFi/refs/heads/main/security/root-ca.pem > ./security/root-ca.pem
4+
CURRENT_DIR=$(basename "$PWD")
5+
6+
OUTPUT_DIR_PATH_PREFIX="../"
7+
# If we are in a "scripts" subdirectory that has a parent containing common project markers
8+
if [[ "$CURRENT_DIR" == "scripts" && ( -f ../Makefile || -f ../README.* || -d ../src || -d ../app ) ]]; then
9+
OUTPUT_DIR_PATH_PREFIX="../"
10+
# If we are in a project root (heuristic: has a scripts/ folder or common project files)
11+
elif [[ -d scripts || -f Makefile || -f README.* || -d src || -d app ]]; then
12+
OUTPUT_DIR_PATH_PREFIX="./"
13+
fi
14+
15+
curl https://raw.githubusercontent.com/CogStack/CogStack-NiFi/refs/heads/main/deploy/general.env > ${OUTPUT_DIR_PATH_PREFIX}env/general.env
16+
curl https://raw.githubusercontent.com/CogStack/CogStack-NiFi/refs/heads/main/security/certificates/root/root-ca.key > ${OUTPUT_DIR_PATH_PREFIX}security/root-ca.key
17+
curl https://raw.githubusercontent.com/CogStack/CogStack-NiFi/refs/heads/main/security/certificates/root/root-ca.pem > ${OUTPUT_DIR_PATH_PREFIX}security/root-ca.pem

0 commit comments

Comments
 (0)