From aeeb92be472922ea8c5e0f328ad5aa96607d0074 Mon Sep 17 00:00:00 2001 From: Wayne Date: Mon, 27 May 2019 23:08:13 +0800 Subject: [PATCH] Minor update --- Release.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Release.ps1 b/Release.ps1 index b56921b47..a2601c238 100644 --- a/Release.ps1 +++ b/Release.ps1 @@ -1,6 +1,6 @@ Add-Type -assembly "system.io.compression.filesystem" $source = "Release" -$destination = "ZKEACMS.Core.zip" +$destination = "ZKEACMS.zip" Write-Host "Starting release" $destination Write-Host "This may take a few minutes, please wait..." if(Test-Path $source){ @@ -14,10 +14,14 @@ Set-Location src/ZKEACMS.WebHost Invoke-Expression("publish-zkeacms") Set-Location ../../ Write-Host "Copy files..." -Copy-Item -Path "src/ZKEACMS.WebHost/bin/Release/PublishOutput" -Destination "Release/Application" -Force -Recurse +New-Item -Path "." -Name "Release" -ItemType "directory" -Force +Move-Item -Path "src/ZKEACMS.WebHost/bin/Release/PublishOutput" -Destination "Release/Application" +New-Item -Path "Release/Application" -Name "App_Data" -ItemType "directory" +Copy-Item -Path "DataBase/SQLite/Database.sqlite" -Destination "Release/Application/App_Data/Database.sqlite" -Force +Copy-Item -Path "DataBase/SQLite/appsettings.json" -Destination "Release/Application/appsettings.json" -Force $dbSource = 'DataBase' $dbDestination = 'Release/Database' -$exclude = @('*.mdf','*.ldf') +$exclude = @('*.mdf','*.ldf','*.cmd','*.exe','*.dll','*.sh','*.json') $length =(Get-Item -Path ".\" -Verbose).FullName.Length + $dbSource.Length + 1 Get-ChildItem $dbSource -Recurse -Exclude $exclude | Copy-Item -Destination {Join-Path $dbDestination $_.FullName.Substring($length)} Write-Host "Archive to" $destination