From 7916b102fca75179b371c2bf64af00f16154f3da Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Fri, 2 Dec 2016 09:14:41 +0100 Subject: [PATCH 1/2] Security is more hidden now --- zsh/security.zsh | 11 +++++++++++ zshrc | 10 +--------- 2 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 zsh/security.zsh diff --git a/zsh/security.zsh b/zsh/security.zsh new file mode 100644 index 0000000..7ef6132 --- /dev/null +++ b/zsh/security.zsh @@ -0,0 +1,11 @@ +# Check if zshrc has been modified +# I like jokes, but I prefer when I'm the one who makes them +git -C $DOTFILES diff --exit-code zshrc zsh > /dev/null 2>&1 + +if [ $? -ne 0 ]; then + echo >&2 "Your zshrc has been modified... nothing will be executed, please check it" + alias source=: + return +fi + + diff --git a/zshrc b/zshrc index 282ab82..4e0e2b8 100644 --- a/zshrc +++ b/zshrc @@ -3,21 +3,13 @@ # Path to the dotfiles DOTFILES=$HOME/.config/dotfiles -# Check if zshrc has been modified -# I like jokes, but I prefer when I'm the one who makes them -git -C $DOTFILES diff --exit-code zshrc zsh > /dev/null 2>&1 - -if [ $? -ne 0 ]; then - echo >&2 "Your zshrc has been modified... nothing will be executed, please check it" - return -fi - # Path to your oh-my-zsh configuration ZSH=$HOME/.oh-my-zsh ZSH_CUSTOM=$HOME/.config/dotfiles/zsh/oh-my-zsh ZSH_THEME="laptop" +source $DOTFILES/zsh/security.zsh source $DOTFILES/zsh/exports.zsh source $DOTFILES/zsh/config.zsh source $DOTFILES/zsh/aliases.zsh From dfa05359bc502afe7dbb8081f8fc450057035e8a Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Fri, 2 Dec 2016 09:16:54 +0100 Subject: [PATCH 2/2] Security more hidden --- zsh/config.zsh | 12 ++++++++---- zsh/security.zsh | 11 ----------- zshrc | 3 +-- 3 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 zsh/security.zsh diff --git a/zsh/config.zsh b/zsh/config.zsh index 7b9e28a..80db45c 100644 --- a/zsh/config.zsh +++ b/zsh/config.zsh @@ -1,8 +1,12 @@ -# Path to your oh-my-zsh configuration. -ZSH=$HOME/.oh-my-zsh -ZSH_CUSTOM=$DOTFILES/zsh/oh-my-zsh +# Check if zshrc has been modified +# I like jokes, but I prefer when I'm the one who makes them +git -C $DOTFILES diff --exit-code zshrc zsh > /dev/null 2>&1 -ZSH_THEME="laptop" +if [ $? -ne 0 ]; then + echo >&2 "Your zshrc has been modified... nothing will be executed, please check it" + alias source=: + return +fi # Set to this to use case-sensitive completion # CASE_SENSITIVE="true" diff --git a/zsh/security.zsh b/zsh/security.zsh deleted file mode 100644 index 7ef6132..0000000 --- a/zsh/security.zsh +++ /dev/null @@ -1,11 +0,0 @@ -# Check if zshrc has been modified -# I like jokes, but I prefer when I'm the one who makes them -git -C $DOTFILES diff --exit-code zshrc zsh > /dev/null 2>&1 - -if [ $? -ne 0 ]; then - echo >&2 "Your zshrc has been modified... nothing will be executed, please check it" - alias source=: - return -fi - - diff --git a/zshrc b/zshrc index 4e0e2b8..fb210ee 100644 --- a/zshrc +++ b/zshrc @@ -9,9 +9,8 @@ ZSH_CUSTOM=$HOME/.config/dotfiles/zsh/oh-my-zsh ZSH_THEME="laptop" -source $DOTFILES/zsh/security.zsh -source $DOTFILES/zsh/exports.zsh source $DOTFILES/zsh/config.zsh +source $DOTFILES/zsh/exports.zsh source $DOTFILES/zsh/aliases.zsh source $DOTFILES/zsh/functions.zsh