Skip to content

Commit

Permalink
update cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharlie committed Jul 17, 2022
1 parent 41fb8f6 commit 43e17e7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion geodata/cleanup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cd (Split-Path -Parent $MyInvocation.MyCommand.Path)

# remove files by pattern
Get-ChildItem -Path $pwd -Include *.zip, *.qgs, *.qgz, *.py -Recurse | Where {$_.fullname -notmatch "test" } | Where {$_.fullname -notmatch "seed" } | Remove-Item -Verbose
Get-ChildItem -Path $pwd -Include *.zip, *.qgs, *.qgz, *.py, *.geojson -Recurse | Where {$_.fullname -notmatch "test" } | Where {$_.fullname -notmatch "seed" } | Remove-Item -Verbose

# clobber blank directories
# note that this needs to be iterated because empty directories with empty directories are not caught
Expand Down
2 changes: 1 addition & 1 deletion geodata/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ THISDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $THISDIR

# remove files
find . \( -name "test" -o -name "seed" \) -prune -o -type f \( -name "*.py" -o -name "*.qgs" -o -name "*.qgz" -o -name ".zip" \) -print0 | xargs -0 rm -vf
find . \( -name "test" -o -name "seed" \) -prune -o -type f \( -name "*.py" -o -name "*.qgs" -o -name "*.qgz" -o -name ".zip" -o -name ".geojson" \) -print0 | xargs -0 rm -vf

# Remove empty directories
find . \( -name "test" -o -name "seed" \) -prune -o -type d -empty -print0 | xargs -0 -r rmdir -v
Empty file.

0 comments on commit 43e17e7

Please sign in to comment.