update script: 7zip (faster) + fix trim file end
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Script di creazione e compilazione versione per test in macchina
|
||||
|
||||
# Prerequisito: da administrator --> installare 7zip cmdlet (rif https://www.sans.org/blog/powershell-7-zip-module-versus-compress-archive-with-encryption/)
|
||||
# Install-Module -Name 7Zip4Powershell
|
||||
|
||||
|
||||
# Check parameters
|
||||
Param (
|
||||
[Parameter(Mandatory=$True)]
|
||||
@@ -43,9 +47,9 @@ if($npmBuild -eq "y")
|
||||
{
|
||||
DoLog("START file replace")
|
||||
# replace seriate server dev (seriate.steamware.net) --> produzione (locahost)
|
||||
((Get-Content -path index.html -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path index.html
|
||||
((Get-Content -path config.development.json -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path config.development.json
|
||||
((Get-Content -path config.production.json -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path config.production.json
|
||||
((Get-Content -path index.html -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path index.html -NoNewline
|
||||
((Get-Content -path config.development.json -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path config.development.json -NoNewline
|
||||
((Get-Content -path config.production.json -Raw) -replace 'seriate.steamware.net','localhost') | Set-Content -Path config.production.json -NoNewline
|
||||
|
||||
# build pacchetti npm
|
||||
DoLog("START npm run build ")
|
||||
@@ -65,9 +69,10 @@ DoLog("END copy step")
|
||||
|
||||
# Compression step
|
||||
DoLog("START ZIP step")
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
Compress-Archive -CompressionLevel Fastest -Force -Path C:\Users\samuele\Desktop\ThermoActive -DestinationPath "C:\Users\samuele\Desktop\ThermoActive_$version.zip" | Out-File c:\tmp\Script.log -Append
|
||||
$ProgressPreference = "Continue"
|
||||
Compress-7Zip -Path C:\Users\samuele\Desktop\ThermoActive -ArchiveFileName "C:\Users\samuele\Desktop\ThermoActive_7zip.zip" -Format Zip
|
||||
#$ProgressPreference = "SilentlyContinue"
|
||||
#Compress-Archive -CompressionLevel Fastest -Force -Path C:\Users\samuele\Desktop\ThermoActive -DestinationPath "C:\Users\samuele\Desktop\ThermoActive_$version.zip" | Out-File c:\tmp\Script.log -Append
|
||||
#$ProgressPreference = "Continue"
|
||||
DoLog("END ZIP step")
|
||||
|
||||
$StopWatch.Stop()
|
||||
|
||||
Reference in New Issue
Block a user