Skip to content

Instantly share code, notes, and snippets.

@cpyle0819
Created May 2, 2024 20:31
Show Gist options
  • Save cpyle0819/516ccd2ec359122b17c741f46ea6af08 to your computer and use it in GitHub Desktop.
Save cpyle0819/516ccd2ec359122b17c741f46ea6af08 to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
# Array of command names
sdk_commands=(
GetObjectCommand
)
# Client name
client=s3
# Base URL for documentation
base_url="https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/$client/command"
# Function to fetch and save documentation
fetch_doc() {
local cmd="$1"
local url="${base_url}/${cmd}"
local output_file="${cmd}.md"
echo "Fetching documentation from ${url}..."
curl -sL "${url}" > "${output_file}"
echo "Documentation saved to ${output_file}"
}
# Loop through commands and fetch documentation
for cmd in "${sdk_commands[@]}"; do
fetch_doc "$cmd"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment