diff --git a/create_zip.bat b/create_zip.bat new file mode 100644 index 0000000..cf78df8 --- /dev/null +++ b/create_zip.bat @@ -0,0 +1,18 @@ +@echo off +setlocal + +:: Nome del file zip con data e ora +for /f "tokens=1-3 delims=/" %%a in ("%date%") do set DATA=%%c-%%b-%%a +for /f "tokens=1-2 delims=:." %%a in ("%time: =0%") do set ORA=%%a%%b +set NOME_ZIP=sito.zip + +echo Creazione archivio: %NOME_ZIP% + +powershell -NoProfile -Command ^ + "$items = @('src','static','svelte.config.js','vite.config.ts','package.json','package-lock.json','yarn.lock','tsconfig.json','recensioni.json');" ^ + "$existing = $items | Where-Object { Test-Path $_ };" ^ + "Compress-Archive -Path $existing -DestinationPath '%NOME_ZIP%' -Force" + +echo. +echo Fatto! Archivio creato: %NOME_ZIP% +pause \ No newline at end of file diff --git a/create_zip.sh b/create_zip.sh new file mode 100644 index 0000000..3b1c1bc --- /dev/null +++ b/create_zip.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Nome del file zip con data e ora +NOME_ZIP="sito.zip" + +echo "Creazione archivio: $NOME_ZIP" + +# Controlla che zip sia disponibile +if ! command -v zip &> /dev/null; then + echo "ERRORE: 'zip' non trovato. Installalo con: sudo pacman -S zip" + exit 1 +fi + +zip -r "$NOME_ZIP" \ + src/ \ + static/ \ + svelte.config.js \ + vite.config.ts \ + package.json \ + package-lock.json \ + yarn.lock \ + tsconfig.json \ + recensioni.json \ + --exclude "*/node_modules/*" \ + --exclude "*/.svelte-kit/*" \ + --exclude "*/build/*" + +echo "" +echo "Fatto! Archivio creato: $NOME_ZIP" \ No newline at end of file