AppVeyor provides build worker images for windows, linux and macos to run unit tests.
So we can use the same appveyor.yml to control builds running on both these OS.
What can we use to distinguish beetween linux and macos?
I need a solution in command line. I had thought of solution as using python -c "import platform; platform.system()", but how can I get the result in this case?
In Bash:
platform=$(uname -s)
if [[ $platform == Darwin ]]; then
echo "it's macOS"
elif [[ $platform == Linux ]]; then
echo "it's Linux"
else
From Python: What OS am I running on?
>>> import platform
>>> platform.system()
'Windows' # for Linux it prints 'Linux', Mac it prints `'Darwin'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.