simbit18 commented on code in PR #15989: URL: https://github.com/apache/nuttx/pull/15989#discussion_r1995770573
########## tools/ci/platforms/windows.ps1: ########## @@ -0,0 +1,307 @@ +#!/usr/bin/env pswd +############################################################################ +# tools/ci/platforms/windows.ps1 +# PowerShell script for CI on Windows Native +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +# Windows native + +# Set-PSDebug -Trace 0 + +function add_path() { + param ( + [string]$Path + ) + if (!$Path) { + Write-Host "Error: add_path path file not found" -ForegroundColor Red + return + } + $envPaths = $env:Path -split ';' + if ($envPaths -notcontains $Path) { + Add-Content -Path "$NUTTXTOOLS\env.ps1" -Value "add_path $Path" + $env:PATH = "$Path;" + $env:PATH + } +} + +function add_envpath { + param( + [string] $envfile + ) + $head = @" +#!/usr/bin/env pswd +############################################################################ +# env.ps1 Review Comment: Hi @xiaoxiang781216 Why ? The env.ps1 script is a file generated after downloading the toolchain or tool. The main function of env.ps1 is to add environment variables the behavior is the same as the bash env.sh echo "#!/usr/bin/env sh" > "${NUTTXTOOLS}"/env.sh https://github.com/apache/nuttx/blob/8abd5dfd8dbfc60887acba05f43ed96c21aa4b28/tools/ci/platforms/ubuntu.sh#L449 echo "PATH=${PATH}" >> "${NUTTXTOOLS}"/env.sh echo "export PATH" >> "${NUTTXTOOLS}"/env.sh https://github.com/apache/nuttx/blob/8abd5dfd8dbfc60887acba05f43ed96c21aa4b28/tools/ci/platforms/ubuntu.sh#L459 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org