Skip to content
Permalink
Browse files

Add vs code and split things (#2)

* Break out the functions into their own file, add some options, script for each machine I care about

* Remove ms-kubernetes-movetools.vscode-kubernetes-tools

* Add new options to vscode config

* Add moreutils

* Make submodules pull over https

* Remove tokbox servers & add ansible

* Install xcode & extensions in code insiders

* Reminder of everything I did not in setup-config.sh

* pam_yubico
  • Loading branch information...
thepatrick committed Jun 1, 2019
1 parent a7c1e6b commit 7d72011195de90b0bf60d929a246185217c00d3c
Showing with 300 additions and 98 deletions.
  1. +4 −4 .gitmodules
  2. +5 −9 config/ssh/config
  3. +7 −1 config/visual-studio-code.json
  4. +82 −0 functions.sh
  5. +165 −84 setup-config.sh
  6. +5 −0 setup-hope.sh
  7. +32 −0 setup-new-mac.sh
@@ -1,12 +1,12 @@
[submodule "vim/bundle/command-t"]
path = vim/bundle/command-t
url = git://github.com/wincent/command-t.git
url = https://github.com/wincent/command-t.git
[submodule "vim/bundle/vim-airline"]
path = vim/bundle/vim-airline
url = git://github.com/bling/vim-airline.git
url = https://github.com/bling/vim-airline.git
[submodule "vim/bundle/syntastic"]
path = vim/bundle/syntastic
url = git://github.com/scrooloose/syntastic.git
url = https://github.com/scrooloose/syntastic.git
[submodule "vim/bundle/nerdtree"]
path = vim/bundle/nerdtree
url = https://github.com/scrooloose/nerdtree.git
@@ -18,4 +18,4 @@
url = https://github.com/edc/bass
[submodule "vim/bundle/vim-unimpaired"]
path = vim/bundle/vim-unimpaired
url = git@github.com:tpope/vim-unimpaired.git
url = https://github.com/tpope/vim-unimpaired.git
@@ -9,20 +9,16 @@ Host digby
Host bouncer
HostName bouncer.digby.us.bigtr.net
ForwardAgent yes

Host sf
User jenkins
HostName pqg.corp.tokbox.com


# Host 10.192.11.*
# ProxyCommand ssh gateway-host nc -w 120 %h %p
# StrictHostKeyChecking no
# UserKnownHostsFile /dev/null

Host dropbear002-dev
User pqg
HostName 52.32.238.94
ForwardAgent yes

Host ansible1-syd
HostName ansible1-syd.thepatrick.cloud
User patrick

# By default my username is patrick.
Host *
@@ -1,5 +1,11 @@
{
"editor.tabSize": 2,
"editor.minimap.enabled": false,
"eslint.autoFixOnSave": true
"eslint.autoFixOnSave": true,
"standard.autoFixOnSave": true,
"gitlens.views.repositories.location": "gitlens",
"gitlens.views.fileHistory.location": "gitlens",
"gitlens.views.lineHistory.location": "gitlens",
"gitlens.views.compare.location": "gitlens",
"gitlens.views.search.location": "gitlens"
}
@@ -0,0 +1,82 @@
set -e
set -u

function setup_link() {
if [ -h "$2" ]; then
if [ `readlink "$2"` != "$1" ]; then
echo $2 -h exists but points to `readlink "$2"`, remove it and run $0 again.
fi
elif [ -d "$2" ]; then
echo "$2" -d exists, move it aside and run $0 again.
elif [ -f "$2" ]; then
echo "$2" -f exists, move it aside and run $0 again.
else
echo "$2" linking to "$1"
ln -s "$1" "$2"
fi
}

function setup_dir() {
if [ ! -d $1 ]; then
mkdir -p $1
fi
}

function download_if_missing() {
if [ ! -f $2 ]; then
curl --silent $1 > $2
chmod +x $2
fi
}

function brew_if_missing() {
if [ ! -e "$2" ]; then
brew install "$1"
fi
}

function brew_cask_if_missing() {
if [ ! -d "$2" ]; then
brew cask install "$1"
fi
}

function apt_if_missing() {
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $1|grep "install ok installed")
#echo Checking for $1: $PKG_OK
if [ "" == "$PKG_OK" ]; then
echo "Installing $1"
sudo apt-get --yes install $1
#else
# echo "$1 installed already"
fi
}

function add_ppa_if_missing() {
SRC_LINE_COUNT=$(grep -c $1 /etc/apt/sources.list.d/*.list | grep -c -v ":0")
if [ "0" == "$SRC_LINE_COUNT" ]; then
echo "Adding ppa:$1"
sudo apt-add-repository ppa:$1
else
echo "I think ppa:$1 is already set up"
fi
}

function cache_vscode_extensions() {
$1 --list-extensions > $1-extensions.txt
}

function add_vscode_extension_if_missing() {
# PKG_COUNT=$()
if ! chronic grep -c $2 $1-extensions.txt; then
echo "Adding extension: $2"
chronic $1 --install-extension $2
fi
}

function mas_if_missing() {
if [ ! -d "$2" ]; then
echo "Installing from App Store: $1 to provide $2"
mas install "$1"
fi
}

0 comments on commit 7d72011

Please sign in to comment.
You can’t perform that action at this time.