Skip to content

Commit 378fc98

Browse files
Try and fix Windows HW and TOOLS paths
1 parent bce91f3 commit 378fc98

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tools/build.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,33 +109,31 @@ def main():
109109
args = parse_args()
110110

111111
ide_path = args.ide_path
112-
try:
113-
print("IDE dir1: ", ide_path)
114-
except:
115-
pass
116112
if not ide_path:
117113
ide_path = os.environ.get('ARDUINO_IDE_PATH')
118114
if not ide_path:
119115
print("Please specify Arduino IDE path via --ide_path option"
120116
"or ARDUINO_IDE_PATH environment variable.", file=sys.stderr)
121117
return 2
122118

123-
print("IDE dir2: ", ide_path)
124119
sketch_path = args.sketch_path
125120
tmp_dir = args.build_path
126121
created_tmp_dir = False
127122
if not tmp_dir:
128123
tmp_dir = tempfile.mkdtemp()
129124
created_tmp_dir = True
130125

131-
tools_dir = os.path.dirname(os.path.realpath(__file__)) + '/../tools'
132-
# this is not the correct hardware folder to add.
133-
hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '/../cores'
126+
if platform.system() == "Windows":
127+
tools_dir = os.path.dirname(os.path.realpath(__file__)) + '\\..\\tools'
128+
hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '\\..\\cores'
129+
else:
130+
tools_dir = os.path.dirname(os.path.realpath(__file__)) + '/../tools'
131+
# this is not the correct hardware folder to add.
132+
hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '/../cores'
134133

135134
output_name = tmp_dir + '/' + os.path.basename(sketch_path) + '.bin'
136135

137136
if args.verbose:
138-
print("IDE dir: ", ide_path)
139137
print("Sketch: ", sketch_path)
140138
print("Build dir: ", tmp_dir)
141139
print("Cache dir: ", args.build_cache)

0 commit comments

Comments
 (0)