diff options
| author | Mitsuo Tokumori <[email protected]> | 2024-09-11 04:25:38 +0900 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2024-09-11 04:25:38 +0900 |
| commit | 37ff7062874b72bafa99afe661f42653565ed511 (patch) | |
| tree | 60372bf7fdb94c9034c7d1cc5a17cd7df526c4fc /public/.local/bin/lp1-unzip_deletebinaries_zip.sh | |
| parent | dca319b8d9d221f1aaf3a00ee457d202096c66ac (diff) | |
| download | dotfiles-37ff7062874b72bafa99afe661f42653565ed511.tar.gz dotfiles-37ff7062874b72bafa99afe661f42653565ed511.tar.bz2 dotfiles-37ff7062874b72bafa99afe661f42653565ed511.zip | |
RESTRUCTURE. Replicate relative paths in public/
Diffstat (limited to 'public/.local/bin/lp1-unzip_deletebinaries_zip.sh')
| -rwxr-xr-x | public/.local/bin/lp1-unzip_deletebinaries_zip.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/public/.local/bin/lp1-unzip_deletebinaries_zip.sh b/public/.local/bin/lp1-unzip_deletebinaries_zip.sh new file mode 100755 index 0000000..3fa4afb --- /dev/null +++ b/public/.local/bin/lp1-unzip_deletebinaries_zip.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Script for LP1 labs that are uploaded to Google Drive with binaries and +# that causes problems with Google Drive's automatic virus scan. + +# unzip +for f in *.zip; do unzip -q "$f"; done + +# delete build/ and dist/ directories (virus detection in Google Drive) +find . -type d -regex '^.*/\(dist\|build\)$' -print0 | xargs -0 rm -r + +# zip +rm *.zip # remove old zip files +for d in */; do + dirname="${d%/}" + zip -qr "$dirname.zip" "$d" +done + +# dos2unix (for me) +find . -type f -iregex ".*\.\(csv\|cpp\|h\|hpp\)" -print0 | xargs -0 dos2unix |
