Archives — 7-Zip without the junk
Everyday Send clients a zip, notnode_modules.Install 7-Zip CLI
- Install 7-Zip
- Ensure
7zis on PATH (oftenC:\Program Files\7-Zip\7z.exe)
powershell
7z --helpZip a project excluding heavy folders
PowerShell (from parent of project):
powershell
$src = "D:\sites\client\awesome-theme"
$out = "D:\deliveries\awesome-theme-$(Get-Date -Format yyyyMMdd).zip"
# 7z exclude syntax: -xr!pattern (recursive)
& 7z a -tzip $out $src `
-xr!node_modules `
-xr!.git `
-xr!vendor `
-xr!dist `
-xr!build `
-xr!.next `
-xr!coverage `
-xr!.ddev\data `
-xr!*.logCommon excludes
| Pattern | Why |
|---|---|
node_modules | Reinstall with npm/pnpm |
.git | Unless they need full history |
vendor | PHP Composer — reinstall |
dist / build / .next | Rebuild |
.ddev/data / DB dumps | Huge + often sensitive |
.env | Never ship secrets |
Exclude env files explicitly
powershell
& 7z a -tzip $out $src -xr!node_modules -xr!.git -x!*.env -x!.env*List / test archive
powershell
7z l $out
7z t $outWSL / bash equivalent
bash
cd /mnt/d/sites/client
zip -r ~/deliveries/theme.zip awesome-theme \
-x '*/node_modules/*' \
-x '*/.git/*' \
-x '*/vendor/*' \
-x '*/.env'Or with 7z inside WSL if installed.
tar.gz for Linux hosts
bash
tar --exclude=node_modules --exclude=.git -czf theme.tgz awesome-theme