Skip to content

Instantly share code, notes, and snippets.

@cori
Last active January 27, 2019 04:42
Show Gist options
  • Save cori/9a39a672ca8f0297e59436d58ce3393c to your computer and use it in GitHub Desktop.
Save cori/9a39a672ca8f0297e59436d58ce3393c to your computer and use it in GitHub Desktop.
init file to set up glitch env
#! /bin/bash
# this script adds ~3Mb to your glitch container's /app directory
# `wget https://gist.githubusercontent.com/cori/9a39a672ca8f0297e59436d58ce3393c/raw -O glitch-init.sh`
# `chmod +x glitch-init.sh`
# `./glitch-init.sh`
# `source ~/.bashrc`
# install bash-it
if [ -d ~/.bash_it ]; then
source ~/.bashrc
else
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
/app/.bash_it/install.sh --silent
source ~/.bashrc
bash-it enable alias git
bash-it enable completion git
bash-it enable completion hub
bash-it enable completion todo
bash-it enable plugin todo
bash-it enable plugin git
bash-it enable plugin hub
fi
git config --global user.name "cori"
git config --global user.email "cori.schlegel@gmail.com"
git config user.name "cori"
git config user.email "cori.schlegel@gmail.com"
echo '*.bak' >> .gitignore
echo '.wget-hsts' >> .gitignore
echo 'glitch-init.sh' >> .gitignore
echo '.bash_it/' >> .gitignore
if ! [ -f .bash_it/aliases/custom.aliases.bash ]; then
# update this with your preferred author information
# this will let you use `gcg` to commit to your repo as yourself avoiding the tendency of Glitch to overwrite committer info
author="\\\"cori schlegel <cori.schlegel@gmail.com>\\\""
cat > .bash_it/aliases/custom.aliases.bash <<< "alias gcg=\"git commit --author='$author' -v -am\""
fi
refresh
@cori
Copy link
Author

cori commented Jun 25, 2018

21b6a8cdf1fc1568e0ff413f513a16ef9cfcf183 finally actually works as hoped

@cori
Copy link
Author

cori commented Oct 19, 2018

bash alias still not quite right - ends up with embedded double-quotes that make it fail

@cori
Copy link
Author

cori commented Jan 27, 2019

https://stackoverflow.com/a/3557165/8151 for better .gitignore handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment