Fix check-dev-env.ps1 encoding for Windows PowerShell

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yuquanjun 2026-08-26 07:28:03 +08:00
parent 89fa953006
commit 9ee3b562f6
1 changed files with 14 additions and 17 deletions

View File

@ -1,14 +1,14 @@
#Requires -Version 5.1
<#
.SYNOPSIS
检查 YNGJ-GT1-M AT32F403ARCT7 工程开发环境是否就绪
Check YNGJ-GT1-M AT32F403ARCT7 development environment.
#>
$ErrorActionPreference = "SilentlyContinue"
$projectRoot = Split-Path $PSScriptRoot -Parent
Write-Host "=== YNGJ-GT1-M 开发环境检查 ===" -ForegroundColor Cyan
Write-Host "工程路径: $projectRoot`n"
Write-Host "=== YNGJ-GT1-M Dev Environment Check ===" -ForegroundColor Cyan
Write-Host "Project: $projectRoot`n"
function Test-Command($name, $cmd) {
$found = Get-Command $cmd -ErrorAction SilentlyContinue
@ -16,21 +16,19 @@ function Test-Command($name, $cmd) {
Write-Host "[OK] $name -> $($found.Source)" -ForegroundColor Green
return $true
} else {
Write-Host "[缺失] $name" -ForegroundColor Red
Write-Host "[MISS] $name" -ForegroundColor Red
return $false
}
}
# Git
Test-Command "Git" "git" | Out-Null
# J-Link
$jlink = Test-Command "J-Link" "JLink"
if (-not $jlink) {
Write-Host " 安装: winget install NordicSemiconductor.JLink" -ForegroundColor Yellow
Write-Host " Install: winget install NordicSemiconductor.JLink" -ForegroundColor Yellow
Write-Host " Or download: https://www.segger.com/downloads/jlink/" -ForegroundColor Yellow
}
# IAR - search common install paths
$iarPaths = @(
"C:\Program Files\IAR Systems",
"C:\Program Files (x86)\IAR Systems",
@ -51,11 +49,10 @@ foreach ($base in $iarPaths) {
}
}
if (-not $iarFound) {
Write-Host "[缺失] IAR Embedded Workbench for ARM" -ForegroundColor Red
Write-Host " 下载: https://www.iar.com/embedded-development-tools/free-trials" -ForegroundColor Yellow
Write-Host "[MISS] IAR Embedded Workbench for ARM" -ForegroundColor Red
Write-Host " Download: https://www.iar.com/embedded-development-tools/free-trials" -ForegroundColor Yellow
}
# AT32 Device Pack - check for ArteryTek DDF in IAR config
$at32Pack = $false
foreach ($base in $iarPaths) {
$ddf = Get-ChildItem -Path $base -Recurse -Filter "AT32F403AxC*.ddf" -ErrorAction SilentlyContinue | Select-Object -First 1
@ -66,16 +63,16 @@ foreach ($base in $iarPaths) {
}
}
if (-not $at32Pack -and $iarFound) {
Write-Host "[缺失] AT32 IAR Device Pack (ArteryTek)" -ForegroundColor Red
Write-Host " 下载: https://www.arterytek.com/cn/product/AT32F403A.jsp" -ForegroundColor Yellow
Write-Host "[MISS] AT32 IAR Device Pack (ArteryTek)" -ForegroundColor Red
Write-Host " Download: https://www.arterytek.com/cn/product/AT32F403A.jsp" -ForegroundColor Yellow
}
# Project files
Write-Host ""
if (Test-Path "$projectRoot\project\IAR_V7.4\YNGJ-GT1-M.eww") {
Write-Host "[OK] 主工程 YNGJ-GT1-M.eww" -ForegroundColor Green
Write-Host "[OK] Main project YNGJ-GT1-M.eww" -ForegroundColor Green
} else {
Write-Host "[缺失] 主工程文件" -ForegroundColor Red
Write-Host "[MISS] Main project file" -ForegroundColor Red
}
Write-Host "`n详细配置说明见: DEVELOPMENT_SETUP.md" -ForegroundColor Cyan
Write-Host ""
Write-Host "See DEVELOPMENT_SETUP.md for full setup guide." -ForegroundColor Cyan