Fix udev.rules warning under Linux Mint

This commit is contained in:
Ivan Kravets
2016-09-18 23:48:10 +03:00
parent 02e7ff6b19
commit 543a137506

View File

@@ -115,8 +115,10 @@ def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument
if env.subst("$PIOFRAMEWORK") == "mbed": if env.subst("$PIOFRAMEWORK") == "mbed":
env.Replace(UPLOAD_PORT=_look_for_mbed_disk()) env.Replace(UPLOAD_PORT=_look_for_mbed_disk())
else: else:
if (system() == "Linux" and if (system() == "Linux" and not any([
not isfile("/etc/udev/99-platformio-udev.rules")): isfile("/etc/udev/99-platformio-udev.rules"),
isfile("/etc/rules.d/99-platformio-udev.rules")
])):
sys.stderr.write( sys.stderr.write(
"\nWarning! Please install `99-platformio-udev.rules` and " "\nWarning! Please install `99-platformio-udev.rules` and "
"check that your board's PID and VID are listed in the rules." "check that your board's PID and VID are listed in the rules."