-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.ps1
More file actions
49 lines (34 loc) · 987 Bytes
/
build.ps1
File metadata and controls
49 lines (34 loc) · 987 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$VENV_DIR = "albayan_env"
if (-not (Test-Path $VENV_DIR)) {
Write-Host "Creating virtual environment..."
py -3.13 -m venv $VENV_DIR
}
$activateScript = Join-Path $VENV_DIR "Scripts\Activate.ps1"
Write-Host "Activating virtual environment..."
. $activateScript
Write-Host "Updating pip..."
python -m pip install --upgrade pip
if (Test-Path "requirements.txt") {
Write-Host "Installing/updating libraries from requirements.txt..."
pip install -r requirements.txt --upgrade
}
else {
Write-Host "requirements.txt not found!" -ForegroundColor Red
exit 1
}
$cxFreezeInstalled = pip show cx-freeze 2>$null
if (-not $cxFreezeInstalled) {
Write-Host "Installing cx-Freeze..."
pip install cx-freeze
}
if (Test-Path "setup.py") {
Write-Host "Building the program with cx-Freeze..."
python setup.py build
}
else {
Write-Host "setup.py not found!" -ForegroundColor Red
exit 1
}
deactivate
Write-Host "Done!" -ForegroundColor Green
Pause