further cleanup

update docs and tests
This commit is contained in:
Andrejus
2020-03-03 00:05:41 +00:00
parent 1c7586139f
commit 638c907c06
17 changed files with 266 additions and 68 deletions

View File

@@ -1,33 +1,38 @@
#!/usr/bin/env bash
#
# Script to set up dotfiles repository and run installer.
# Script to set up and run dotfiles installer
#
# Installs git using apt-get if not in $PATH.
# Pulls latest dotfiles repository.
# Installs git using `apt-get` if not in $PATH
# step may be skipped,
# @see $FAST_MODE
#
# Pulls latest target repository using git
# @see $REPOSITORY
#
# Creates workspace if one doesn't already exist
# @see $WORKSPACE
#
# Runs installer
# @see $INSTALLER
#
#
# Usage:
# Usage
#
# i. Run script.
# i. Run script
#
# $ bash bootstrap.sh
# $ bash /path/to/bootstrap.sh
# $ wget path.to/bootstrap.sh -qO - | bash
# $ ./bootstrap.sh
# $ /path/to/bootstrap.sh
#
# ii. Run explicitly in a bash shell.
# ii. Download and run script
#
# $ bash bootstrap.sh
# $ bash /path/to/bootstrap.sh
# $ wget path.to/bootstrap.sh -qO - | bash
# a. non-interactively
# $ wget path.to/bootstrap.sh -qO - | bash
#
# iii. Source into existing shell.
#
# $ source bootstrap.sh
# $ source /path/to/bootstrap.sh
# $ source <(wget -q path.to/bootstrap.sh)
# b. interactively
# $ bash <(wget -qO- path.to/bootstrap.sh)
#
#
# Configuration:
# Configuration
#
# $REPOSITORY - GitHub repository to clone
# @default "andrejusk/dotfiles"
@@ -39,7 +44,7 @@
# @default "install.sh"
#
# $FAST_MODE - whether to skip git (and speed up install steps)
# @defualt unset, i.e. false
# @defualt false
#
#
set -o pipefail
@@ -81,7 +86,7 @@ if [ -z "$FAST_MODE" ]; then
# Ensure latest is pulled
echo "pulling latest..."
if [[ ! -d $dotfiles_dir ]]; then
if ! [ -d "$dotfiles_dir" ]; then
mkdir -p "$dotfiles_dir"
git clone -q "$repository_url" "$dotfiles_dir"
else