Skip to content

Commit

Permalink
Add function test generate key-value pairs in documents.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Tearran committed Jan 5, 2024
1 parent aacb2d5 commit 2b01407
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion lib/armbian-configng/documents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ generate_json() {
echo "[${json_objects[*]}]" | jq
}

generate_keypairs() {
generate_keypairs_test_01() {
for key in "${!functions[@]}"; do
if [[ $key == *",function_name"* ]]; then
function_key="${key%,function_name}"
Expand All @@ -45,6 +45,29 @@ generate_keypairs() {
done
}

generate_keypairs() {

# Define the output file
output_file="keypairs.sh"

# Define the key-value pairs
declare -A keypairs=(
["KEY1"]="VALUE1"
["KEY2"]="VALUE2"
["KEY3"]="VALUE3"
)

# Write the key-value pairs to the output file
echo "#!/bin/bash" > $output_file
for key in "${!keypairs[@]}"; do
echo "export $key=${keypairs[$key]}" >> $output_file
done

# Make the output file executable
chmod +x $output_file

}

# This function is used to generate a armbian CPU logo
generate_svg(){

Expand Down

0 comments on commit 2b01407

Please sign in to comment.