Merge pull request #268 from Discreater/fix_win_multi_VS

fix windows build with multiple visual studio installations
This commit is contained in:
AppFlowy.IO 2022-01-27 10:11:54 +08:00 committed by GitHub
commit f0f4bc0b30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,11 +8,18 @@ dependencies=["check_duckscript_installation", "check_visual_studio_installation
script = """ script = """
output = exec powershell -Command "Get-CimInstance MSFT_VSInstance | select -ExpandProperty Version" output = exec powershell -Command "Get-CimInstance MSFT_VSInstance | select -ExpandProperty Version"
stdout = set ${output.stdout} stdout = set ${output.stdout}
pos = last_indexof ${stdout} . versions = split ${stdout} "\\n"
new_str = substring ${stdout} 0 ${pos} for version in ${versions}
# TODO: will raise error if there are more than 1 visual studio installation pos = last_indexof ${version} .
newer = semver_is_newer ${new_str} 16.11.0 new_str = substring ${version} 0 ${pos}
assert ${newer} "Visual studio 2019 is not installed or version is lower than 16.11.0" newer = semver_is_newer ${new_str} 16.11.0
if newer
goto :ok
end
end
echo "Visual studio 2019 is not installed or version is lower than 16.11.0"
exit -1
:ok
""" """
script_runner = "@duckscript" script_runner = "@duckscript"