Skip to content

Commit

Permalink
doc: extensions: application: Fix multi-os handling
Browse files Browse the repository at this point in the history
Correct the handling of the HOST_OS list so that we do not insert an
extra line break because of the 'all' entry and we correctly insert the
required comment.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
carlescufi committed Feb 12, 2019
1 parent 1b47af0 commit 68b876b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions doc/extensions/zephyr/application.py
Original file line number Diff line number Diff line change
@@ -147,7 +147,8 @@ def run(self):
mkdir = 'mkdir' if num_slashes == 0 else 'mkdir -p'

# Create host_os array
host_os = [host_os] if host_os != "all" else self.HOST_OS
host_os = [host_os] if host_os != "all" else [v for v in self.HOST_OS
if v != 'all']

run_config = {
'board': board,
@@ -168,15 +169,16 @@ def run(self):
comment = '# On {}'

for host in host_os:
if cd_to:
if host == "unix":
if comment:
content.append(comment.format('Linux/macOS'))
if host == "unix":
if comment:
content.append(comment.format('Linux/macOS'))
if cd_to:
prefix = '$ZEPHYR_BASE/' if zephyr_app else ''
content.append('cd {}{}'.format(prefix, cd_to))
elif host == "win":
if comment:
content.append(comment.format('Windows'))
elif host == "win":
if comment:
content.append(comment.format('Windows'))
if cd_to:
prefix = '%ZEPHYR_BASE%\\' if zephyr_app else ''
backslashified = cd_to.replace('/', '\\')
content.append('cd {}{}'.format(prefix, backslashified))

0 comments on commit 68b876b

Please sign in to comment.