Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[powershell] add echo message #198

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions install_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ foreach ($p_cmd in ("python3", "python", "py")) {

cmd /c $RTT_PYTHON --version | findstr "Python" | Out-Null
if (!$?) {
echo "Python not installed. Will install python 3.11.2."
echo "Python is not installed. Will install python 3.11.2."
echo "Downloading Python."
wget -O Python_setup.exe https://www.python.org/ftp/python/3.11.2/python-3.11.2.exe
echo "Installing Python."
Expand All @@ -26,14 +26,18 @@ if (!$?) {
}
echo "Install Python done. please close the current terminal and run this script again."
exit
} else {
echo "Python environment has installed. Jump this step."
}

$git_url = "https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe"
if ($args[0] -eq "--gitee") {
echo "Use gitee mirror server!"
$git_url = "https://registry.npmmirror.com/-/binary/git-for-windows/v2.39.2.windows.1/Git-2.39.2-64-bit.exe"
}

if (!(Test-Command git)) {
echo "Git not installed. Will install Git."
echo "Git is not installed. Will install Git."
echo "Installing git."
winget install --id Git.Git -e --source winget
if (!$?) {
Expand All @@ -44,6 +48,8 @@ if (!(Test-Command git)) {
cmd /c Git64.exe /quiet PrependPath=1
exit
}
} else {
echo "Git environment has installed. Jump this step."
}

$PIP_SOURCE = "https://pypi.org/simple"
Expand All @@ -57,19 +63,25 @@ cmd /c $RTT_PYTHON -m pip list -i $PIP_SOURCE --trusted-host $PIP_HOST | Out-Nul
if (!$?) {
echo "Installing pip."
cmd /c $RTT_PYTHON -m ensurepip --upgrade
} else {
echo "Pip has installed. Jump this step."
}

cmd /c $RTT_PYTHON -m pip install --upgrade pip -i $PIP_SOURCE --trusted-host $PIP_HOST | Out-Null

if (!(Test-Command scons)) {
echo "Installing scons."
cmd /c $RTT_PYTHON -m pip install scons -i $PIP_SOURCE --trusted-host $PIP_HOST
} else {
echo "Scons has installed. Jump this step."
}

cmd /c $RTT_PYTHON -m pip list -i $PIP_SOURCE --trusted-host $PIP_HOST | findstr "requests" | Out-Null
if (!$?) {
echo "Installing requests."
echo "Installing requests module."
cmd /c $RTT_PYTHON -m pip install requests -i $PIP_SOURCE --trusted-host $PIP_HOST
} else {
echo "requests module has installed. Jump this step."
}

$url="https://raw.githubusercontent.com/RT-Thread/env/master/touch_env.ps1"
Expand All @@ -78,4 +90,5 @@ if ($args[0] -eq "--gitee") {
}

wget $url -O touch_env.ps1
echo "run touch_env.ps1"
./touch_env.ps1 $args[0]