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 json
import os import os
import re import re
import sys
from os.path import abspath, basename, expanduser, isdir, isfile, join, relpath from os.path import abspath, basename, expanduser, isdir, isfile, join, relpath
import bottle import bottle
@ -146,7 +147,8 @@ class ProjectGenerator(object):
"project_libdeps_dir": util.get_projectlibdeps_dir(), "project_libdeps_dir": util.get_projectlibdeps_dir(),
"systype": util.get_systype(), "systype": util.get_systype(),
"platformio_path": self._fix_os_path( "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_pathsep": os.pathsep,
"env_path": self._fix_os_path(os.getenv("PATH")) "env_path": self._fix_os_path(os.getenv("PATH"))
}) # yapf: disable }) # yapf: disable

View File

@ -4,7 +4,7 @@
{ {
"cmd": "cmd":
[ [
"platformio", "{{ platformio_path }}",
"-f", "-c", "sublimetext", "-f", "-c", "sublimetext",
"run" "run"
], ],
@ -14,7 +14,7 @@
{ {
"cmd": "cmd":
[ [
"platformio", "{{ platformio_path }}",
"-f", "-c", "sublimetext", "-f", "-c", "sublimetext",
"run" "run"
], ],
@ -23,27 +23,7 @@
{ {
"cmd": "cmd":
[ [
"platformio", "{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
"clean"
],
"name": "Clean"
},
{
"cmd":
[
"platformio",
"-f", "-c", "sublimetext",
"test"
],
"name": "Test"
},
{
"cmd":
[
"platformio",
"-f", "-c", "sublimetext", "-f", "-c", "sublimetext",
"run", "run",
"--target", "--target",
@ -54,7 +34,27 @@
{ {
"cmd": "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", "-f", "-c", "sublimetext",
"run", "run",
"--target", "--target",
@ -65,7 +65,7 @@
{ {
"cmd": "cmd":
[ [
"platformio", "{{ platformio_path }}",
"-f", "-c", "sublimetext", "-f", "-c", "sublimetext",
"run", "run",
"--target", "--target",
@ -76,16 +76,24 @@
{ {
"cmd": "cmd":
[ [
"platformio", "{{ platformio_path }}",
"-f", "-c", "sublimetext", "-f", "-c", "sublimetext",
"update" "update"
], ],
"name": "Update platforms and libraries" "name": "Update platforms and libraries"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"upgrade"
],
"name": "Upgrade PlatformIO Core"
} }
], ],
"working_dir": "${project_path:${folder}}", "working_dir": "${project_path:${folder}}",
"selector": "source.c, source.c++", "selector": "source.c, source.c++"
"path": "{{env_path}}"
} }
], ],
"folders": "folders":
@ -98,7 +106,7 @@
{ {
"sublimegdb_workingdir": "{{project_dir}}", "sublimegdb_workingdir": "{{project_dir}}",
"sublimegdb_exec_cmd": "", "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"
} }
} }