Created
March 21, 2024 21:58
-
-
Save robertjdominguez/5b75a4628106e7b544b24752ac7a067b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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