#!/bin/sh if ! command -v "git" &> /dev/null; then echo "Mi requires \`git\`. Please install it." exit 0 fi local_dir="${HOME}/.local" if [ ! -d "${local_dir}" ]; then mkdir "${local_dir}" fi force="${FORCE:-}" dest="${local_dir}/mi" if [ -d "${dest}" ]; then if [ -z "${force}" ]; then pushd "${dest}" echo "Here is your setting collection at ${dest}. bye." exit 0 fi rm -rf "${dest}" fi pushd "${local_dir}" &> /dev/null git clone git@github.com:mtwtkman/mi.git popd &> /dev/null pushd "${dest}" &> /dev/null ./mi install popd &> /dev/null source "$HOME/.bash_profile"