Skip to content

Commit

Permalink
partials: pass workspace directory as property
Browse files Browse the repository at this point in the history
Partials are used on both Zephyr and NCS setup but the workspace directory is
different between the two. This commit adds a property to ensure the correct
workspace directory name for the install.

Signed-off-by: Mike Szczys <mike@golioth.io>
  • Loading branch information
szczys committed Jan 4, 2024
1 parent a2b5cbe commit 8e9eb62
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions docs/partials-common/setup-west-nrf91.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sudo apt install --no-install-recommends git cmake ninja-build gperf \
make gcc gcc-multilib g++-multilib libsdl2-dev
```

<SetupZephyrUnix />
<SetupZephyrUnix workspace_directory="golioth-ncs-workspace" />

</TabItem>
<TabItem value="macos">
Expand All @@ -39,14 +39,14 @@ Start by installing dependencies with `brew`:
brew install cmake ninja gperf python3 ccache qemu dtc
```

<SetupZephyrUnix />
<SetupZephyrUnix workspace_directory="golioth-ncs-workspace" />

</TabItem>
<TabItem value="windows">

import SetupWestNRF91Windows from '/docs/partials-common/setup-west-nrf91-windows.md'

<SetupWestNRF91Windows />
<SetupWestNRF91Windows workspace_directory="golioth-ncs-workspace" />

</TabItem>
</Tabs>
Expand Down
18 changes: 9 additions & 9 deletions docs/partials-common/setup-zephyr-unix.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import CodeBlock from '@theme/CodeBlock';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

We recommend creating a `python3` virtual environment to avoid running into
tooling incompatibilities.

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs
groupId="west-installation"
defaultValue="global"
Expand All @@ -19,15 +19,15 @@ Create a new version environment:
Even though we haven't pulled down Zephyr yet, we can create the virtual environment in the place where we _will_ pull
down Zephyr.

```
python3 -m venv ~/golioth-zephyr-workspace/.venv
```
<CodeBlock>
python3 -m venv ~/{props.workspace_directory}/.venv
</CodeBlock>

Activate the virtual environment:

```
source ~/golioth-zephyr-workspace/.venv/bin/activate
```
<CodeBlock>
source ~/{props.workspace_directory}/.venv/bin/activate
</CodeBlock>

Whenever the virtual environment is active, your shell's prompt will be prefixed with `(.venv)`.

Expand Down
4 changes: 2 additions & 2 deletions docs/partials-common/setup-zephyr-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ values={[

```shell
cd c:\
python -m venv golioth-zephyr-workspace\.venv
python -m venv {props.workspace_directory}\.venv
```

2. Activate the virtual environment:

```shell
c:\golioth-zephyr-workspace\.venv\Scripts\activate.bat
c:\{props.workspace_directory}\.venv\Scripts\activate.bat
```

Once activated your shell will be prefixed with `(.venv)`. The virtual environment can be deactivated at any time by running `deactivate`.
Expand Down
6 changes: 3 additions & 3 deletions docs/partials-common/setup-zephyr.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cmake --version

If the Kitware repository doesn't work for you (ie: your system is not running Ubuntu 20.04), you can [build the stable version of CMake from source](https://cmake.org/install/).

<SetupZephyrUnix />
<SetupZephyrUnix workspace_directory="golioth-zephyr-workspace" />

</TabItem>
<TabItem value="macos">
Expand All @@ -58,7 +58,7 @@ Start by installing dependencies with `brew`:
brew install cmake ninja gperf python3 ccache qemu dtc
```

<SetupZephyrUnix />
<SetupZephyrUnix workspace_directory="golioth-zephyr-workspace" />

</TabItem>
<TabItem value="windows">
Expand Down Expand Up @@ -99,7 +99,7 @@ The [chocolatey](https://chocolatey.org/) package manager needs to be installed

import SetupZephyrWindows from './setup-zephyr-windows.md'

<SetupZephyrWindows />
<SetupZephyrWindows workspace_directory="golioth-zephyr-workspace" />

</TabItem>
</Tabs>

0 comments on commit 8e9eb62

Please sign in to comment.