From f878cfe8f5ed1d19c97a21dc3ef91e918b5c752b Mon Sep 17 00:00:00 2001 From: Benjamin MABILLE Date: Thu, 8 Nov 2018 17:47:05 +0100 Subject: [PATCH] Readme + Docker test + Bash evol --- Dockerfile | 5 +++++ Makefile | 19 +++++++++++++++++++ README.md | 8 +++++++- docker-compose.yml | 7 +++++++ install_zsh.sh | 20 ++++++++++++++------ 5 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ad1cc6b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM debian:jessie + +COPY ./ /srv + +VOLUME /srv \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fb4a90d --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +DOCKER_COMPOSE = docker-compose + +EXEC_DEBIAN = $(DOCKER_COMPOSE) exec -T debian /entrypoint + +start: + printf "\033[32m You can go take a coffee while we work for you \033[0m\n" + $(DOCKER_COMPOSE) pull + $(DOCKER_COMPOSE) up -d --remove-orphans debian + +stop: + $(DOCKER_COMPOSE) stop + +run: + $(EXEC_DEBIAN) ./install_zsh.sh + +connect: ## Connect to the container of the project + $(EXEC_DEBIAN) + +.PHONY: start stop run connect diff --git a/README.md b/README.md index f21893a..cb109f1 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -# zsh_powerlevel9k_installer +### Custom ZSH and powerlevel9k autoinstaller for debian + +Install software and fonts needed ; customise ~/.zshrc ; etting zsh as default shell + +**Installation :** + +Just run ./install_zsh.sh and enjoy ! \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bb25f18 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3.4' + +services: + debian: + image: debian:jessie + volumes: + - ./:/srv:ro \ No newline at end of file diff --git a/install_zsh.sh b/install_zsh.sh index 67db415..dfab2d8 100755 --- a/install_zsh.sh +++ b/install_zsh.sh @@ -1,4 +1,9 @@ #!/bin/bash +# Install script for ZSH and Powerlevel9k + +set -e +set -u + if which tput >/dev/null 2>&1; then ncolors=$(tput colors) fi @@ -18,10 +23,13 @@ else NORMAL="" fi -set -e - command -v git >/dev/null 2>&1 || { - echo "Error: git is not installed" + echo "${RED}Error: git is not installed${NORMAL}" + exit 1 +} + +command -v tee >/dev/null 2>&1 || { + echo "${RED}Error: tee is not installed${NORMAL}" exit 1 } @@ -37,17 +45,17 @@ fc-cache -f -v printf "${BLUE}Cloning powerlevel9k...${NORMAL}\n" env git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k || { - printf "Error: git clone of powerlevel9k repo failed\n" + printf "${RED}Error: git clone of powerlevel9k repo failed${NORMAL}\n" exit 1 } printf "${BLUE}Cloning zsh-autosuggestions...${NORMAL}\n" env git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions || { - printf "Error: git clone of zsh-autosuggestions repo failed\n" + printf "${RED}Error: git clone of zsh-autosuggestions repo failed${NORMAL}\n" exit 1 } printf "${BLUE}Cloning zsh-syntax-highlighting...${NORMAL}\n" env git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting || { - printf "Error: git clone of zsh-syntax-highlighting repo failed\n" + printf "${RED}Error: git clone of zsh-syntax-highlighting repo failed\${NORMAL}n" exit 1 }