Skip to content

Instantly share code, notes, and snippets.

@janstuemmel
Last active May 26, 2020 13:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janstuemmel/5dea680981d443c8d93c9c7e12f08611 to your computer and use it in GitHub Desktop.
Save janstuemmel/5dea680981d443c8d93c9c7e12f08611 to your computer and use it in GitHub Desktop.
Installation script for a portable platformio editor

a simple install script to build a portable version of the PlatformIO IDE based on the atom editor.

referenced to platformio/platformio-atom-ide/issues/158

Usage

  • wget https://gist.githubusercontent.com/janstuemmel/5dea680981d443c8d93c9c7e12f08611/raw/install.sh
  • chmod +x install.sh
  • execute: ./install.sh v1.14.4

after this you get following directory structure:

.
├── install.sh
└── PlatformIO
    ├── atom # compiled atomsource
    ├── config # your .atom folder, normally located in your home dir
    ├── piopm.sh # atom package manager wrapper
    └── platformio-ide.sh # atom wrapper
#!/bin/bash
# builds platformIO IDE portable on debian based machines
# usage: ./install.sh v1.14.4
# add dirs
mkdir -p PlatformIO && cd PlatformIO &&
# downloads compiled atom by version or exits on 404
(wget https://github.com/atom/atom/releases/download/$1/atom-amd64.tar.gz ||
(echo "No matching version found" && exit 1) ) &&
# extract
tar xzvf atom-amd64.tar.gz &&
# delete archive
rm *.tar.gz &&
# rename
mv atom-* atom &&
# add config folder
mkdir config &&
# add sh wrapper files
echo '#!/bin/bash' >> platformio-ide.sh &&
echo 'ATOM_HOME=$(dirname $(readlink -f $0))/config $(dirname $(readlink -f $0))/atom/atom $@' >> platformio-ide.sh &&
chmod +x platformio-ide.sh &&
echo '#!/bin/bash' >> piopm.sh &&
echo 'ATOM_HOME=$(dirname $(readlink -f $0))/config $(dirname $(readlink -f $0))/atom/resources/app/apm/bin/apm $@' >> piopm.sh &&
chmod +x piopm.sh &&
# install platformio
./piopm.sh install platformio-ide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment