Skip to content

Commit 800ce1f

Browse files
authored
Merge pull request #184 from Portkey-AI/chore/vKeyScript
virtual key script
2 parents c83e761 + f924661 commit 800ce1f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/virtual_keys_replacement.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ process_files_in_directory() {
2626

2727
# Find all .json files in the directory and its subdirectories
2828
find "$directory" -type f -name "*.json" | while read -r file; do
29-
replace_words_in_file "$file" virtual_keys virtual_keys_values
29+
replace_words_in_file "$file" virtual_keys[@] virtual_keys_values[@]
3030
echo "Processed file: $file"
3131
done
3232
}
@@ -46,7 +46,6 @@ directory="tests/configs"
4646
virtual_keys=("openai-virtual-key" "anyscale-virtual-key" "azure-virtual-key" "cohere-virtual-key" "anthropic-virtual-key" "stability-virtual-key")
4747
virtual_keys_values=("openai_value" "anyscale_value" "azure_value" "cohere_value" "anthropic_value" "stability_value")
4848

49-
5049
# Check if the directory exists
5150
if [[ ! -d "$directory" ]]; then
5251
echo "Directory does not exist. Please provide a valid directory path."
@@ -62,6 +61,5 @@ if [[ "$1" == "--undo" ]]; then
6261
virtual_keys_values=("${temp_words[@]}")
6362
fi
6463

65-
66-
process_files_in_directory "$directory" virtual_keys virtual_keys_values
64+
process_files_in_directory "$directory" virtual_keys[@] virtual_keys_values[@]
6765
echo "Virutal Key replacement completed."

0 commit comments

Comments
 (0)