feat: publish script and cleanup

This commit is contained in:
Andrejus
2021-05-02 21:53:29 +01:00
parent fb50593834
commit 1f569c7e09
22 changed files with 144 additions and 58 deletions

View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
poetry --version

View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
java --version

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
if [ ! -d ~/.emacs.d ]; then
echo "Cloning spacemacs"
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
fi

View File

@@ -3,9 +3,11 @@ docker --version
readonly docker_group="docker"
if ! grep -q "$docker_group" /etc/group; then
echo "Adding docker group"
sudo groupadd "$docker_group"
fi
if ! groups "$USER" | grep -q "\b$docker_group\b"; then
echo "Adding user to docker group"
sudo usermod -aG docker "$USER"
fi

View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
gcloud --version

View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
firebase --version

View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
aws --version

View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
terraform --version

View File

@@ -51,6 +51,7 @@
"fish",
"fonts-nanum",
"fortune-mod",
"fzf",
"google-cloud-sdk",
"git",
"kubectl",

11
scripts/publish.sh Normal file → Executable file
View File

@@ -1,8 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail
#
# Script that publishes the set up script for new installations.
#
BUCKET=${BUCKET:-"dots.andrejus.dev"}
echo "Publishing..."
NAME=$(basename "$0")
REL_DIR=$(dirname "$0")
ABS_DIR=$(readlink -f $REL_DIR/../) # Scripts are nested inside of /scripts
# Publish setup script to public bucket
gsutil cp "$ABS_DIR/scripts/setup.sh" "gs://$BUCKET/setup.sh"

View File

@@ -15,7 +15,7 @@ setup_dir=${DOTFILES_DIR:-$HOME/.dotfiles}
# Prevent overwriting existing installation
mkdir -p $setup_dir
if [ -z `ls -A $setup_dir` ]; then
if [[ -z $(ls -A $setup_dir) ]]; then
echo "Setting up $setup_dir"
else
echo "Failed: Setup directory not empty $setup_dir"