Skip to content

Instantly share code, notes, and snippets.

@robertjdominguez
Created March 21, 2024 21:58
Show Gist options
  • Save robertjdominguez/5b75a4628106e7b544b24752ac7a067b to your computer and use it in GitHub Desktop.
Save robertjdominguez/5b75a4628106e7b544b24752ac7a067b to your computer and use it in GitHub Desktop.
#!/bin/bash
# Get 'em
projects=$(ddn get project)
# Find 'em
project_names=$(echo "$projects" | grep -E '^[|]' | awk -F'|' '{print $3}' | sed 's/ //g')
# (Duke) Nuke'em
echo "$project_names" | while read -r name; do
if [[ ! -z "$name" ]]; then
echo "Deleting project: $name"
ddn delete project "$name"
fi
done
echo "All projects have been deleted."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment