Add a message to know if the server is running or not.
[valheim_web.git] / deploy.ps1
old mode 100644 (file)
new mode 100755 (executable)
index f9b7dbf..5635894
@@ -1,3 +1,5 @@
+#!/usr/bin/env pwsh
+
 if ($args.Count -lt 1) {
    $scriptName = [Environment]::GetCommandLineArgs()[1]
    Write-Output "Usage: $scriptName <destination>"
@@ -7,7 +9,7 @@ if ($args.Count -lt 1) {
 git pull
 cargo build --release
 
-systemctl --user stop valheim-web
+systemctl --user stop valheim_web
 
 $destination=$args[0]
 
@@ -15,15 +17,15 @@ if (!(Test-Path -Path $destination)) {
    New-Item -ItemType directory -Path $destination
 }
 
-strip target/release/valheim-web # To reduce the executable size.
-Copy-Item target/release/valheim-web -Destination $destination
+strip target/release/valheim_web # To reduce the executable size.
+Copy-Item target/release/valheim_web -Destination $destination
 
-Copy-Item static -Destination $destination -Recurse -Force
+Copy-Item backend/static -Destination $destination -Recurse -Force
 
 # Do not overwrite the configuration.
 if (!(Test-Path -Path $destination/conf.ron)) {
-   Copy-Item conf.ron -Destination $destination
+   Copy-Item backend/conf.ron -Destination $destination
 }
 
-systemctl --user start valheim-web
+systemctl --user start valheim_web