Use full path to PlatformIO CLI when generate project for IDE

This commit is contained in:
Ivan Kravets
2018-12-13 17:24:08 +02:00
parent 3748219cac
commit 9f4dde4b5e
2 changed files with 40 additions and 30 deletions

View File

@ -15,6 +15,7 @@
import json
import os
import re
import sys
from os.path import abspath, basename, expanduser, isdir, isfile, join, relpath
import bottle
@ -146,7 +147,8 @@ class ProjectGenerator(object):
"project_libdeps_dir": util.get_projectlibdeps_dir(),
"systype": util.get_systype(),
"platformio_path": self._fix_os_path(
util.where_is_program("platformio")),
sys.argv[0] if isfile(sys.argv[0])
else util.where_is_program("platformio")),
"env_pathsep": os.pathsep,
"env_path": self._fix_os_path(os.getenv("PATH"))
}) # yapf: disable

View File

@ -4,7 +4,7 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run"
],
@ -14,7 +14,7 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run"
],
@ -23,27 +23,7 @@
{
"cmd":
[
"platformio",
"-f", "-c", "sublimetext",
"run",
"--target",
"clean"
],
"name": "Clean"
},
{
"cmd":
[
"platformio",
"-f", "-c", "sublimetext",
"test"
],
"name": "Test"
},
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
@ -54,7 +34,27 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
"clean"
],
"name": "Clean"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"test"
],
"name": "Test"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
@ -65,7 +65,7 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
@ -76,16 +76,24 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"update"
],
"name": "Update platforms and libraries"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"upgrade"
],
"name": "Upgrade PlatformIO Core"
}
],
"working_dir": "${project_path:${folder}}",
"selector": "source.c, source.c++",
"path": "{{env_path}}"
"selector": "source.c, source.c++"
}
],
"folders":
@ -98,7 +106,7 @@
{
"sublimegdb_workingdir": "{{project_dir}}",
"sublimegdb_exec_cmd": "",
"sublimegdb_commandline": "{{platformio_path}} -f -c sublimetext debug --interface=gdb --interpreter=mi -x .pioinit"
"sublimegdb_commandline": "{{ platformio_path }} -f -c sublimetext debug --interface=gdb --interpreter=mi -x .pioinit"
}
}