add VSCodium and let it manage golang tools

This commit is contained in:
Frieder Schlesier 2019-10-15 20:36:22 +02:00
parent 4fdfb8e054
commit 4f30b3771d
1 changed files with 26 additions and 77 deletions

View File

@ -258,6 +258,25 @@ install_i3() {
sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard
}
install_vscodium() {
# https://vscodium.com/
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add -
echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list
apt update
apt install -y \
codium \
--no-install-recommends
codium version
# ms-azuretools.vscode-docker
# ms-vscode.go
# vscodevim.vim
}
install_docker() {
# https://docs.docker.com/install/linux/docker-ce/debian/#install-using-the-repository
@ -377,80 +396,8 @@ install_golang() {
(
curl -sSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | $SUDO tar -v -C /usr/local -xz
)
# get commandline tools
(
set -x
set +e
go get github.com/golang/lint/golint
go get golang.org/x/tools/cmd/cover
go get golang.org/x/review/git-codereview
go get -u -v github.com/rogpeppe/godef
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v golang.org/x/tools/cmd/goimports
go get github.com/mdempsky/gocode
#done
)
}
get_public_go_projects() {
(
aliases=( Masterminds/glide onsi/ginkgo onsi/gomega gogits/gogs fschl/CompileDaemon )
for project in "${aliases[@]}"; do
owner=$(dirname "$project")
repo=$(basename "$project")
if [[ -d "${HOME}/${repo}" ]]; then
rm -rf "${HOME}/${repo}"
fi
mkdir -p "${GOPATH}/src/github.com/${owner}"
if [[ ! -d "${GOPATH}/src/github.com/${project}" ]]; then
(
# clone the repo
cd "${GOPATH}/src/github.com/${owner}"
git clone "https://github.com/${project}.git"
# fix the remote path, since our gitconfig will make it git@
cd "${GOPATH}/src/github.com/${project}"
git remote set-url origin "https://github.com/${project}.git"
)
else
echo "found ${project} already in gopath"
fi
# make sure we create the right git remotes
# if [[ "$owner" != "fschl" ]]; then
# (
# cd "${GOPATH}/src/github.com/${project}"
# git remote set-url --push origin no_push
# git remote add jfrazelle "https://github.com/fschl/${repo}.git"
# )
# fi
# create the alias
# ln -snvf "${GOPATH}/src/github.com/${project}" "${HOME}/${repo}"
done
# create symlinks from personal projects to
# the ${HOME} directory
projectsdir=$GOPATH/src/gitlab.com/fschl
base=$(basename "$projectsdir")
find "$projectsdir" -maxdepth 1 -not -name "$base" -type d -print0 | while read -d '' -r dir; do
base=$(basename "$dir")
ln -snvf "$dir" "${HOME}/${base}"
done
)
}
if [ -f "./get_private_stuff.sh" ]; then
source get_private_stuff.sh
fi
main() {
local cmd=$1
@ -473,9 +420,9 @@ main() {
;;
desktop)
# apt_sources buster
base_applications
install_docker
install_compose
base_applications
install_docker
install_compose
install_i3
if [ -f "./get_private_stuff.sh" ]; then
source get_private_stuff.sh
@ -484,13 +431,15 @@ main() {
latex)
install_latex
;;
vscode)
install_vscodium
;;
update-docker)
# install_docker
install_docker
install_compose
;;
go)
install_golang
# get_public_go_projects
;;
esac
}