Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions backend/load-secret.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
#!/bin/bash

# Check if exactly one argument is passed
if [ $# -ne 1 ]; then
echo "expected at least one argument";
exit 1;
echo "Error: expected exactly one argument (path to 'secret.json')."
exit 1
fi

# Check if the 'secret.json' file exists
if [ ! -f "$1" ]; then
echo "Error: 'secret.json' file not found at '$1'."
exit 1
fi

echo "$1" > "./internal/excel/secret.json"
echo "$1" > "./internal/excel_adapter/internals/secret.json"
echo "$1" > "./pkg/excel/secret.json"
echo "$1" > "./pkg/excel_adapter/internals/secret.json"
# Copy the 'secret.json' file to the specified directories
cp "$1" "./internal/excel/secret.json" || { echo "Failed to copy to ./internal/excel/"; exit 1; }
cp "$1" "./internal/excel_adapter/internals/secret.json" || { echo "Failed to copy to ./internal/excel_adapter/internals/"; exit 1; }
cp "$1" "./pkg/excel/secret.json" || { echo "Failed to copy to ./pkg/excel/"; exit 1; }
cp "$1" "./pkg/excel_adapter/internals/secret.json" || { echo "Failed to copy to ./pkg/excel_adapter/internals/"; exit 1; }

echo "'secret.json' successfully copied to all specified directories."