Snippets

ZombyMediaIC Custom atom installer MAIN

Created by ZombyMediaIC last modified
shc -e 30/09/2018 -m "This version is not longer supported please download the newest version or use git pull" -r -f ci_atom.sh && rm ci_atom.sh && mv ci_atom.sh.x ci_atom.sh && rm ci_atom.sh.x.c
#!/bin/bash
cd ../assets/
date=($(jq -r '.license' assets/env-online.json))

cd ../installer

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"

function confInstall {

  MY_PATH=`dirname "$0"`
  MY_PATH=`( cd "$MY_PATH" && pwd )`

  cd $MY_PATH/installer/assets/settings

  ./ci_settings.sh

  sleep 2
  clear
  exit
}

function install_git_curl {
    sleep 4

    sudo apt-get update

    echo -e "\e[33mChecking for git installation \e[39m"
    dpkg -s git 2>/dev/null >/dev/null || sudo apt-get -y install git
    echo ""

    echo -e "\e[33mChecking for curl installation \e[39m"
    dpkg -s curl 2>/dev/null >/dev/null || sudo apt-get -y install curl
    echo " "

    sudo apt-get install -y gconf2 gconf-service python gconf-service-backend libgconf-2-4 python2.7 libpython-stdlib python2 gconf2-common libpython2-stdlib
    sudo apt --fix-broken install
}

function updateScript {
  echo -e "\e[92mScript is up to date"
}

clear
echo "The script need curl and git to be installed!"
echo "If this is not the case we will install git and curl for you..."
echo -e "\e[92mLicense is valid until ${date[0]} \e[39m"

install_git_curl
sleep 1
git fetch
clear

sleep 0.5

UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")

if [ $LOCAL = $REMOTE ]; then
    echo "Thanks for choosing the custom atom version"
    echo -e "\e[33mEnter install, ci_conf or cancel\e[39m"
    read inputresult
elif [ $LOCAL = $BASE ]; then
    echo "Thanks for choosing the custom atom version"
    echo -e "\e[92mA Update is available\e[39m"
    echo " "
    echo "Please update the script first"
    echo -e "\e[33mEnter update or cancel\e[39m"
    read inputresult
else
    echo -e "\e[91mERROR: {649} \e[33mThe repository has too many unshared changes \e[39m"
fi


if [ "$inputresult" == "install" ]; then
    clear

    echo -e "\e[33mLoading installer... \e[39m "

    echo ""
elif [ "$inputresult" == "update" ]; then
    echo " "
    echo -e "\e[33mChecking for Updates... \e[39m"
    updateScript
elif [ "$inputresult" == "ci_conf" ]; then
    confInstall
else
    exit
fi

function getMaster_bundle {

        echo -e  "\e[33mMove package file to correct location \e[39m"

        wget https://bundle.my-world.space/master_bundle.zip

        echo -e  "\e[33munpacking folders... \e[39m"
        unzip master_bundle.zip -d ./

        rm master_bundle.zip

        clear
}
function getLarge_bundle {

          echo -e  "\e[33mMove package file to correct location \e[39m"

          wget https://bundle.my-world.space/large_bundle.zip

          echo -e  "\e[33munpacking folders... \e[39m"
          unzip large_bundle.zip -d ./

          rm large_bundle.zip

          clear
}
function getMedium_bundle {

          echo -e  "\e[33mMove package file to correct location \e[39m"

          wget https://bundle.my-world.space/medium_bundle.zip

          echo -e  "\e[33munpacking folders... \e[39m"
          unzip medium_bundle.zip -d ./

          rm medium_bundle.zip

          clear
}
function getSmall_bundle {

            echo -e  "\e[33mMove package file to correct location \e[39m"

            wget https://bundle.my-world.space/small_bundle.zip

            echo -e  "\e[33munpacking folders... \e[39m"
            unzip small_bundle.zip -d ./

            rm small_bundle.zip

            clear
}
function getLight_bundle {

              echo -e  "\e[33mMove package file to correct location \e[39m"

              wget https://bundle.my-world.space/light_bundle.zip

              echo -e  "\e[33munpacking folders... \e[39m"
              unzip light_bundle.zip -d ./

              rm light_bundle.zip

              clear
}
function getCustom_bundle {

echo "Do you want to load the bundle from a website or a git repository?"
echo "Enter: W | R"
read mode

if [[ "$mode" == "W" ]]; then
  clear

function download {
  echo -e  "\e[33mLoading package file from webpage \e[39m"

  wget $1

  echo -e  "\e[33munpacking folders... \e[39m"
  unzip $2 -d ./

  rm $2.zip

  clear
}
  echo "Enter website URL:"
  read webUrl

    echo "Enter package file name:"
    read name
    download "$webUrl" "$name"


else
  echo "Please enter the repository url:"
  read repurl

  git clone $repurl

  url=$1"_bundle/"
  zipname=$1"_bundle.zip"

  cd $url

  echo -e  "\e[33mMove package file to correct location \e[39m"
  mv $zipname ~/.atom/packages/
  cd ..

  echo -e  "\e[33munpacking folders... \e[39m"
  unzip $zipname -d ./

  rm $zipname
  sudo rm -rf $url
  sleep 1
  clear
fi
}

sleep 1

clear
echo -e  "\e[33mStarting installer... \e[39m"
sleep 1



echo "Enter Mode | P - Packages || A - ALL:"
read pmode

if [[ "$pmode" != "P" ]]; then
  MACHINE_TYPE=`uname -m`
  if [ ${MACHINE_TYPE} == 'x86_64' ]; then
    cd assets/
    file=atom-amd64.deb
    if [ -e "$file" ]; then
      rm atom-amd64.deb
      if [ "$(. /etc/lsb-release; echo $DISTRIB_DESCRIPTION)" = "Ubuntu 18.04.1 LTS" ]; then
          wget -O atom-amd64.deb https://atom.io/download/deb
          sudo apt-get install -y gdebi-core
          sudo gdebi atom-amd64.deb
      else
          wget wget -O atom-amd64.deb https://atom.io/download/deb
          sudo dpkg -i atom-amd64.deb
      fi
    else
      if [ "$(. /etc/lsb-release; echo $DISTRIB_DESCRIPTION)" = "Ubuntu 18.04.1 LTS" ]; then
          wget -O atom-amd64.deb https://atom.io/download/deb
          sudo apt-get install -y gdebi-core
          sudo gdebi atom-amd64.deb
      else
          wget wget -O atom-amd64.deb https://atom.io/download/deb
          sudo dpkg -i atom-amd64.deb
      fi
    fi
    cd ..
  else
      sudo add-apt-repository ppa:webupd8team/atom
      sudo apt-get update
      sudo apt-get install -y atom
  fi

fi


if which atom >/dev/null; then
    sleep 1
    echo -e  "\e[33mInstallation is done \e[39m"
    rm atom-amd64.deb
    echo " "
    clear
    echo -e  "\e[33mStarting installation of plugins for atom \e[39m"
    sleep 2

    cd ~/

    Directory=.atom

    if [ ! -d ~/.atom ]
    then
        mkdir .atom
    fi

    sleep 1

    cd ~/.atom

    sudo rm -rf ~/.atom/packages

    echo -e  "\e[33mCreate packages folder \e[39m"
    mkdir packages

    cd packages

    echo -e  "\e[33mClone package from Bitbucket \e[39m"
    sleep 1
    clear

    echo -e "\e[33mWhat kind of package do you want to install?\e[39m"
    echo "You always can change that later"
    echo ""
    echo "Master Package: Includes all Packages"
    echo "Large Package: Includes most of the Packages"
    echo "Medium Package: Includes some Packages"
    echo "Small Package: Includes a few  of the Packages"
    echo "Light Package: Includes only the framework Packages"
    echo "Custom Package: Own or package from other user"

    echo ""
    echo "Enter The size in lowercase:"
    read userinput

    clear

if [ "$userinput" == "master" ]; then
echo -e "\e[33mStarting Installation of the Master package..."
sudo rm -rf ~/.atom/packages/*
getMaster_bundle
fi

if [ "$userinput" == "large" ]; then
echo -e "\e[33mStarting Installation of the Large package..."
sudo rm -rf ~/.atom/packages/*
getLarge_bundle
fi

if [ "$userinput" == "medium" ]; then
echo -e "\e[33mStarting Installation of the Medium package..."
sudo rm -rf ~/.atom/packages/*
getMedium_bundle
fi

if [ "$userinput" == "small" ]; then
sudo rm -rf ~/.atom/packages/*
echo -e "\e[33mStarting Installation of the Small package..."
getSmall_bundle
fi

if [ "$userinput" == "light" ]; then
sudo rm -rf ~/.atom/packages/*
echo -e "\e[33mStarting Installation of the Light package..."
getLight_bundle
fi

if [ "$userinput" == "custom" ]; then
sudo rm -rf ~/.atom/packages/*
echo -e "\e[33mStarting Installation of the Light package..."
echo ""

echo "Enter bundle name without _bundle: or for other mode press enter"
read bundname
echo ""
getCustom_bundle "$bundname"
fi

    confInstall

    echo -e "\e[92mInstallation is finished"
    echo -e "\e[39mThanks for using the custom version of atom editor"
    echo ""

    echo -e "\e[92mNow change the theme of the atom editor to Arc and the syntax theme to minory"
    sleep 7

    clear
else
    sleep 1
    echo -e  "\e[31mInstallation Failed {ERROR: No Message available} \e[39m"
fi

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.