Created
May 12, 2015 16:47
-
-
Save pkulchenko/3574e47ba1ad89501f91 to your computer and use it in GitHub Desktop.
ZeroBrane Studio installation script for Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INSTALL_PATH=/opt/zbstudio | |
VERSION=$1 | |
echo Installing ZeroBrane Studio $VERSION... | |
if [ -d "$INSTALL_PATH" ]; then | |
if [ -e "$INSTALL_PATH/cfg/user.lua" ]; then | |
echo "Copying cfg/user.lua file..." | |
cp "$INSTALL_PATH/cfg/user.lua" "app/cfg/user.lua" | |
fi | |
sudo rm -r $INSTALL_PATH | |
fi | |
INITIAL_USER=`whoami` | |
sudo mkdir -p $INSTALL_PATH | |
sudo chown -R $INITIAL_USER $INSTALL_PATH | |
sudo cp -rp app/* $INSTALL_PATH | |
for ICON_SIZE in 16 22 24 32 48 64 256 | |
do | |
sudo xdg-icon-resource install --novendor --size $ICON_SIZE $INSTALL_PATH/zbstudio/res/icons/${ICON_SIZE}x${ICON_SIZE}/apps/zbstudio.png "zbstudio" | |
done | |
UPDATE_MENUS="`which update-menus 2>/dev/null`" | |
sudo xdg-desktop-menu install --novendor $INSTALL_PATH/zbstudio/res/zbstudio.desktop | |
if [ -x "$UPDATE_MENUS" ]; then | |
sudo update-menus | |
fi | |
if [ -e "/usr/bin/zbstudio" ]; then | |
sudo rm /usr/bin/zbstudio | |
fi | |
sudo ln -s $INSTALL_PATH/zbstudio.sh /usr/bin/zbstudio | |
sudo chmod +x $INSTALL_PATH/zbstudio.sh | |
echo $VERSION | sudo tee $INSTALL_PATH/VERSION >/dev/null | |
sudo cp uninstall.sh /usr/bin/zbstudio-uninstall | |
sudo chmod +x /usr/bin/zbstudio-uninstall | |
echo Done. | |
echo | |
echo To uninstall ZeroBrane Studio at a later time, run: | |
echo -e ' zbstudio-uninstall' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BIG Thank you , uninstall zero brain was in dreams