Improve setup script [skip ci]

This commit is contained in:
halx99 2023-07-08 12:37:02 +08:00
parent e91020ac34
commit 86c4ef48d1
2 changed files with 26 additions and 5 deletions

17
1k/manifest.ps1 Normal file
View File

@ -0,0 +1,17 @@
# Uncomment to overwrite $manifest in main script build1k.ps1
# $manifest = @{
# msvc = '143+';
# ndk = 'r23c+';
# xcode = '13.0.0~14.2.0'; # range
# clang = '15.0.0+';
# gcc = '9.0.0+';
# cmake = '3.26.4+';
# nuget = '*'; # any
# glslcc = '1.7.6+';
# ninja = '1.11.1+';
# jdk = '11.0.19+';
# cmdlinetools = '7.0+'; # android cmdlinetools
# }
# [void]$manifest

View File

@ -31,18 +31,21 @@ if ($IsWin) {
else {
$PATH = [System.Collections.ArrayList]$env:PATH.Split(':')
if (Test-Path $PROFILE -PathType Leaf) {
$profileContent = Get-Content $PROFILE
$profileContent = Get-Content $PROFILE -raw
}
else {
$profileContent = ''
}
$needSave = $false
if ($profileContent.IndexOf('$env:AX_ROOT = ') -eq -1) {
$profileContent += '$env:AX_ROOT = "{0}"{1}' -f $AX_ROOT, "`n"
$needSave = $true
}
if ($profileContent.IndexOf('$env:PATH = ') -eq -1) {
$profileContent += '$env:PATH = "{0}:$env:PATH"' -f $AX_CONSOLE_BIN
$needSave = $true
}
$profileDir = Split-Path $PROFILE -Parent
@ -50,12 +53,13 @@ else {
mkdir $profileDir | Out-Null
}
Set-Content $PROFILE -Value $profileContent
if ($needSave) {
Set-Content $PROFILE -Value $profileContent
}
}
if ($IsLinux) {
b1k_print "This Shell Script will install dependencies for axmol"
Write-Host "Are you continue? (y/n) " -NoNewline
Write-Host "Are you continue install linux dependencies for axmol? (y/n) " -NoNewline
$answer = Read-Host
if ($answer -like 'y*') {
b1k_print "It will take few minutes"
@ -111,7 +115,7 @@ if ($IsWin) {
}
$parentProcessName = $parentProcess.ProcessName
if ($parentProcessName -like "explorer") {
Write-Host "setup successfully, press any key to exit . . ." -NoNewline
b1k_print "setup successfully, press any key to exit . . ." -NoNewline
cmd /c pause 1>$null
exit 0
}