-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.ps1
44 lines (35 loc) · 1.05 KB
/
start.ps1
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$url = "https://drive.google.com/uc?id=0BzI11xZnqucbUXlkSFB3NzRRS0U&export=download"
$output = "$PSScriptRoot\hugo.exe"
if (!(Test-Path $output)) {
Write-Warning "Will start to download Serverless CMS based on Hugo"
try {
$start_time = Get-Date
Import-Module BitsTransfer
Start-BitsTransfer -Source $url -Destination $output
} Catch {
}
try {
if (!(Test-Path $output)) {
$start_time = Get-Date
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
}
} Catch {
}
try {
if (!(Test-Path $output)) {
$start_time = Get-Date
Invoke-WebRequest -Uri $url -OutFile $output
}
} Catch {
}
}
if (!(Test-Path $output)) {
Write-Host "Could not download file." -ForegroundColor Magenta
} else {
Write-Host "Successfully downloaded file." -ForegroundColor Magenta
$job = Start-Job {
Start-Process "https://127.0.0.1:8081/"
}
& $output serve --bind 0.0.0.0 --forceSyncStatic --destination public --enableApi=true
}