-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathbuild.ps1
55 lines (41 loc) · 1.53 KB
/
build.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
45
46
47
48
49
50
51
52
53
54
55
function log {
param (
$Type,
$Msg
)
switch ($Type) {
"error" { $c = "Red"; $s = "-"; }
"warning" { $c = "Yellow"; $s = "!"; }
"success" { $c = "Green"; $s = "+"; }
default { $c = "Cyan"; $s = "*"; }
}
Write-Host "[$(Get-Date -Format 'yyyy-MM-dd~HH:mm')|$s] " -ForegroundColor $c -NoNewline
Write-Host "$Msg"
}
log "success" 'Building "Figaro"'
$OriginalPath = Get-Location
Set-Location $PSScriptRoot
log "info" "Checking for ffmpeg ... "
if (Test-Path -Path ".\static\ffmpeg.exe") {
log "success" "An ffmpeg build is in the static directory"
} else {
log "info" "Downloading the latest version of ffmpeg"
Invoke-WebRequest "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip" -OutFile "${env:Temp}\ffmpeg.zip"
Expand-Archive -Force "${env:Temp}\ffmpeg.zip" ".\static\"
Move-Item ".\static\*\bin\ffmpeg.exe" ".\static\tmp.exe"
Move-Item ".\static\*\bin\*" ".\static\"
Remove-Item -Path ".\static\ffmpeg*" -Recurse
Move-Item ".\static\tmp.exe" ".\static\ffmpeg.exe"
log "success" "Successfully downloaded ffmpeg!"
}
log "info" "Checking for pyinstaller"
python -m pip install pyinstaller
log "success" "Pyinstaller found/installed!"
log "info" 'Building "figaro-cli" w. pyinstaller'
pyinstaller --noupx -ci ".\media\figaro.ico" .\figaro.py
log "success" 'Finished building "figaro-cli"'
log "info" "Building the GUI"
Set-Location lib/gui/
npm run dist
log "success" "Finished building the GUI"
Set-Location $OriginalPath