-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
33 lines (28 loc) · 1.21 KB
/
Copy pathbuild.ps1
File metadata and controls
33 lines (28 loc) · 1.21 KB
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
param (
[switch]$Windows
)
function Get-FletPath {
$cmd = Get-Command flet -ErrorAction SilentlyContinue
if ($cmd) {
return $cmd.Source
}
$scriptsPath = python -c "import sysconfig; print(sysconfig.get_path('scripts'))"
$userScriptsPath = python -c "import os, site; print(os.path.join(site.USER_BASE, 'Scripts'))"
$versionedUserScriptsPath = python -c "import os, site, sys; print(os.path.join(site.USER_BASE, f'Python{sys.version_info.major}{sys.version_info.minor}', 'Scripts'))"
foreach ($path in @($scriptsPath, $userScriptsPath, $versionedUserScriptsPath)) {
foreach ($name in @("flet.exe", "flet")) {
$candidate = Join-Path $path $name
if (Test-Path $candidate) {
return $candidate
}
}
}
throw "flet CLI not found. Run: pip install -r requirements.txt"
}
$flet_path = Get-FletPath
if ($Windows) {
Write-Host "Building Windows Executable..."
& $flet_path pack main.py --name "PassGuard Prototype" --hidden-import pydantic --hidden-import cryptography --hidden-import argon2 --hidden-import argon2.low_level -y
} else {
Write-Host "Please specify -Windows flag to build the Windows Executable."
}