diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..6b47a7d --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,24 @@ +[user] + + name = "Hactarus" + email = Hactarus@users.noreply.github.com + + +[alias] + pushdev = !git push --set-upstream origin "`git branch --no-color 2>/dev/null | grep '*' | sed -e 's/\\* //'`:dev/hactarus/`git branch --no-color 2>/dev/null | grep '*' | sed -e 's/\\* //'`" + graph = !git log --oneline --graph --abbrev-commit --decorate --date=relative --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)\n' + +[push] + default = simple + +[init] + defaultBranch = main + +[url "ssh://git@gitlab.com"] + insteadOf = "https://www.gitlab.com" + +[url "ssh://git@github.com"] + insteadOf = "https://www.github.com" + +[includeIf "gitdir:~/work"] + path = .gitconfig-work \ No newline at end of file diff --git a/init b/init deleted file mode 100755 index d81b5e3..0000000 --- a/init +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -locale -a | grep -i "utf8" 2>&1 > /dev/null -if [[ ! $? -eq 0 ]]; then - echo -e "\033[31;1mPlease install utf8 locale\033[0m" - exit 1 -fi -_RDIR=$(cd `dirname $0` && pwd) -${_RDIR}/bin/homemaker.amd64 -variant $@ ${_RDIR}/common.toml ${_RDIR} \ No newline at end of file diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..8b8e292 --- /dev/null +++ b/setup.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# make sure we have pulled in and updated any submodules +git submodule init +git submodule update + +# what directories should be installable by all users including the root user +base=( + bash +) + +# folders that should, or only need to be installed for a local user +useronly=( + git +) + +# run the stow command for the passed in directory ($2) in location $1 +stowit() { + usr=$1 + app=$2 + # -v verbose + # -R recursive + # -t target + stow -v -R -t ${usr} ${app} +} + +echo "" +echo "Stowing apps for user: ${whoami}" + +# install apps available to local users and root +for app in ${base[@]}; do + stowit "${HOME}" $app +done + +# install only user space folders +for app in ${useronly[@]}; do + if [[! "$(whoami)" = *"root"*]]; then + stowit "${HOME}" $app + fi +done + +echo "" +echo "##### ALL DONE" \ No newline at end of file