Snippets
Created by
ZombyMediaIC
last modified
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | #!/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)
You can clone a snippet to your computer for local editing. Learn more.