Skip to content

Commit cbb546c

Browse files
committed
Fix some escaping issues on Windows
1 parent 817b8fa commit cbb546c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: cli/compile/compile.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ func NewCommand() *cobra.Command {
6262
Long: "Compiles Arduino sketches.",
6363
Example: "" +
6464
" " + os.Args[0] + " compile -b arduino:avr:uno /home/user/Arduino/MySketch\n" +
65-
" " + os.Args[0] + " compile -b arduino:avr:uno --build-property='build.extra_flags=\"-DMY_DEFINE=\"hello world\"\"' /home/user/Arduino/MySketch\n" +
66-
" " + os.Args[0] + " compile -b arduino:avr:uno --build-property='build.extra_flags=-DPIN=2 \"-DMY_DEFINE=\"hello world\"\"' /home/user/Arduino/MySketch\n" +
67-
" " + os.Args[0] + " compile -b arduino:avr:uno --build-property=build.extra_flags=-DPIN=2 --build-property='compiler.cpp.extra_flags=\"-DSSID=\"hello world\"\"'-DMY_DEFINE=\"hello world\"' /home/user/Arduino/MySketch\n",
65+
" " + os.Args[0] + " compile -b arduino:avr:uno --build-property=\"build.extra_flags=\\\"-DMY_DEFINE=\\\"hello world\\\"\\\"\" /home/user/Arduino/MySketch\n" +
66+
" " + os.Args[0] + " compile -b arduino:avr:uno --build-property=\"build.extra_flags=-DPIN=2 \\\"-DMY_DEFINE=\\\"hello world\\\"\\\"\" /home/user/Arduino/MySketch\n" +
67+
" " + os.Args[0] + " compile -b arduino:avr:uno --build-property=build.extra_flags=-DPIN=2 --build-property=\"compiler.cpp.extra_flags=\\\"-DSSID=\\\"hello world\\\"\\\"\"-DMY_DEFINE=\"hello world\"' /home/user/Arduino/MySketch\n",
6868
Args: cobra.MaximumNArgs(1),
6969
Run: run,
7070
}

Diff for: test/test_compile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ def test_compile_with_multiple_build_property_flags(run_command, data_dir, copy_
319319
# Compile using multiple build properties separated by a space
320320
res = run_command(
321321
f"compile -b {fqbn} "
322-
+ '--build-property=\'compiler.cpp.extra_flags=\\"-DPIN=2 -DSSID=\\"This is a String\\"\\"\' '
322+
+ '--build-property="compiler.cpp.extra_flags=\\"-DPIN=2 -DSSID=\\"This is a String\\"\\"" '
323323
+ f"{sketch_path} --verbose --clean"
324324
)
325325
assert res.failed
326326

327327
# Compile using multiple build properties separated by a space and properly quoted
328328
res = run_command(
329329
f"compile -b {fqbn} "
330-
+ '--build-property=\'compiler.cpp.extra_flags=-DPIN=2 "-DSSID="This is a String""\' '
330+
+ '--build-property="compiler.cpp.extra_flags=-DPIN=2 \\"-DSSID=\\"This is a String\\"\\"" '
331331
+ f"{sketch_path} --verbose --clean"
332332
)
333333
assert res.ok

0 commit comments

Comments
 (0)