Wie man einen "platformio" / "pio"-Shortcut auf der Linux-Kommandozeile hinzufügt

Normalerweise, wenn Sie die pio-Executable von PlatformIO verwenden möchten, müssen Sie zuerst die virtuelle Umgebung aktivieren mit

activate_platformio_bash.sh
source ~/.platformio/penv/bin/activate

Sie können jedoch einfach einen Shortcut mit einem Shell-Alias erstellen:

Für bash:

activate_platformio_zsh.sh
echo -e '\nalias platformio="source ~/.platformio/penv/bin/activate"\n' >> ~/.bashrc

Für zsh:

run_platformio.sh
echo -e '\nalias platformio="source ~/.platformio/penv/bin/activate"\n' >> ~/.zshrc

Beachten Sie, dass damit die Änderung wirksam wird, Sie Ihre Shell neu starten müssen(oder eine neue Shell öffnen).

Jetzt können Sie ausführen

run_platformio.sh
platformio

und Sie haben sofortigen Zugriff auf pio und andere PlatformIO-Tools.


Check out similar posts by category: PlatformIO