-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.ps1
More file actions
29 lines (22 loc) · 847 Bytes
/
deploy.ps1
File metadata and controls
29 lines (22 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Write-Output "`Deploying Melody..."
$cooldown = $env:COOLDOWN
Write-Output "Waiting $cooldown seconds before deploying..."
Start-Sleep -Seconds $cooldown
$deployPath = $env:TARGET.Trim()
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$buildPath = Join-Path $scriptDir "target"
if (-not (Test-Path $deployPath)) {
Write-Output "Deploy folder not found. Creating: $deployPath"
exit 0
}
Write-Output "Searching for built jars..."
$newJar = Get-ChildItem "$buildPath\melody-*.jar" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if ($null -eq $newJar) {
Write-Output "No jar found in $buildPath"
exit 0
}
$destPath = Join-Path $deployPath "melody.jar"
Write-Output "Deploying..."
Copy-Item $newJar.FullName -Destination $destPath -Force
Write-Output "Deployed as melody.jar -> $deployPath"
exit 0