From e477196e628c7808d7c540d297f26a235ec9cf75 Mon Sep 17 00:00:00 2001 From: MORI Taeyeon Date: Mon, 3 Mar 2014 17:19:48 +0100 Subject: [PATCH] Add README, fix some things --- .gitignore | 1 + README.md | 38 ++++++++++++++++++++++++++++++++++++++ install | 25 +++++++++++++++++-------- zsh/lib.zsh | 2 +- zsh/zlogin | 3 ++- zsh/zpreztorc | 3 ++- zsh/zprofile | 4 ++++ zsh/zshrc | 24 ++++++++++++++++++++++++ 8 files changed, 89 insertions(+), 11 deletions(-) create mode 100644 README.md diff --git a/.gitignore b/.gitignore index 207bc1c..2f36698 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /zsh/.* user-info +*.local diff --git a/README.md b/README.md new file mode 100644 index 0000000..562c892 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +Taeyeon's dotfiles (.files) +=========================== + +As of right now, only contains dotfiles for zsh, vim and git. + +.files/install +-------------- +A ZShell script to set up the dotfiles. It will also ask a few personal questions. +Run this on a new system to set it up + +.files/zsh +---------- +The ZSH part makes use of the Prezto framework (http://github.com/sorin-ionescu/prezto) + + +.files/git +---------- +Contains the git configuration (.files/git/config) + +\*/user-info +----------- +Contains user information collected at install time. +currently only .files/user-info and .files/git/user-info + +.files/dotfiles +--------------- +General dotfiles repository. Everything that doesn't need to be special-cased goes here. + +$HOME +----- +All dotfiles are symlinked into the home directory or have a proxy file generated. + +Known proxies: .gitconfig, .zshenv + +\*.local +-------- +Files ending on .local are ignored by git. + diff --git a/install b/install index b3b3dc0..1998194 100755 --- a/install +++ b/install @@ -1,5 +1,5 @@ #!/bin/zsh -# .files installer +# .files/installer # (c) 2014 MORI Taeyeon # Paths & Utils @@ -10,23 +10,26 @@ source "$DOT/zsh/lib.zsh" # Parse commandline OVERWRITE=false +ASK=true function print_usage() { - echo "Usage: $0 [--help] [--overwrite]" + echo "Usage: $1 [--help] [--overwrite] [--dont-ask]" echo echo "Install Tae's dotfiles" echo echo "Parameters:" echo " -h, --help Display this help message" echo " --overwrite Just overwrite existing dotfiles" + echo " --dont-ask Don't ask questions. Use default values" } for arg in "$@"; do [[ -z "$STATE" ]] && { case "$arg" in - -h|--help) print_usage; exit 0;; + -h|--help) print_usage "$0"; exit 0;; --overwrite) OVERWRITE=true;; - *) print_usage; exit 1;; + --dont-ask) ASK=false;; + *) print_usage "$0"; exit 1;; esac } || { case "$STATE" in @@ -59,13 +62,19 @@ msg "Updating git submodules..." git submodule update --init --recursive # Ask questions about user -msg "Asking questions..." +$ASK && msg "Asking questions..." || err "Not asking any questions:" [[ -e "$DOT/user-info" ]] && source "$DOT/user-info" -[[ -z "$REAL_NAME" ]] && REALNAME=`grep "^$USER:[^:]*:$UID:" /etc/passwd | cut -d: -f5 | cut -d, -f1` -ask "Real name" REALNAME -ask "E-Mail address" EMAIL +[[ -z "$REALNAME" ]] && REALNAME=`grep "^$USER:[^:]*:$UID:" /etc/passwd | cut -d: -f5 | cut -d, -f1` + +if $ASK; then + ask " Real name" REALNAME + ask " E-Mail address" EMAIL +else + color 36 echo " default REALNAME=\"$REALNAME\"" + color 36 echo " default EMAIL=\"$EMAIL\"" +fi generate "$DOT/user-info" <