print('Error: IDF_PATH not defined. Please set IDF_PATH as described here:\nhttp://esp-idf.readthedocs.io/en/latest/get-started/index.html#get-started-get-esp-idf');
sys.exit(10)
IDF_PATH=os.environ['IDF_PATH']
print("IDF_PATH=%s"%IDF_PATH)
IDF_COMPONENTS=IDF_PATH+"/components"
ifnotos.path.exists(IDF_COMPONENTS):
print("Error: No components folder at $IDF_PATH/components, please check IDF_PATH")
sys.exit(10)
IDF_BTSTACK=IDF_COMPONENTS+"/btstack"
ifos.path.exists(IDF_BTSTACK):
print("Deleting old BTstack component %s"%IDF_BTSTACK)