1
0
Fork 0

Autocommitted updated scripts from mari-wovn

main
Mari 5 years ago
parent 338b5909fa
commit a8a557b7f5
  1. 8
      bash_aliases.sh
  2. 28
      per-host/mari-wovn/.bash_aliases

@ -88,12 +88,15 @@ function bashreload()
reload_scripts_only reload_scripts_only
} }
function help_prompt() {
echo '\ Help\ page\ '"$@"'\ ?ltline\ %lt?L/%L.:byte\ %bB?s/%s..?\ (END):?pB\ %pB\\%..(press h for help or q to quit)'
}
function man () function man ()
{ {
if command man "$@" >&/dev/null; then if command man "$@" >&/dev/null; then
command man "$@" command man "$@"
elif builtin help -m "$@" >&/dev/null; then elif builtin help -m "$@" >&/dev/null; then
builtin help -m "$@" | command man -l - builtin help -m "$@" | command man -l -r "$(help_prompt "$@")" -
else else
command man "$@" command man "$@"
fi fi
@ -102,7 +105,7 @@ function man ()
function help () function help ()
{ {
if builtin help -m "$@" >&/dev/null; then if builtin help -m "$@" >&/dev/null; then
builtin help "$@" | command man -l - builtin help "$@" | command man -l -r "$(help_prompt "$@")" -
elif command man "$@" >&/dev/null; then elif command man "$@" >&/dev/null; then
command man "$@" command man "$@"
else else
@ -111,6 +114,7 @@ function help ()
builtin help -m "$@" 2>/dev/null || command man "$@" 2>/dev/null || builtin help -m "$@" builtin help -m "$@" 2>/dev/null || command man "$@" 2>/dev/null || builtin help -m "$@"
} }
# This is, almost without fail, the right value. # This is, almost without fail, the right value.
export DISPLAY="${DISPLAY:-:0.0}" export DISPLAY="${DISPLAY:-:0.0}"

@ -9,6 +9,9 @@ auto_tmux
function tmux_start_branch() { function tmux_start_branch() {
( (
set -o errexit
set -o nounset
set -o pipefail
branch=${1:?} branch=${1:?}
tmux -2 new-window -a -t "Main Screen:1" -c ~ -e BRANCH_NAME="$branch" 'bash -ic "start_branch \"\$BRANCH_NAME\"; exec bash"' tmux -2 new-window -a -t "Main Screen:1" -c ~ -e BRANCH_NAME="$branch" 'bash -ic "start_branch \"\$BRANCH_NAME\"; exec bash"'
) )
@ -17,19 +20,21 @@ function tmux_start_branch() {
function start_branch() { function start_branch() {
branch=${1:?} branch=${1:?}
( (
set -eu set -o errexit
set -o nounset
set -o pipefail
if [[ ! -d ~/branches/"$branch" ]]; then if [[ ! -d ~/branches/"$branch" ]]; then
printf "=== Setting up a branch named ${branch}...\n" printf "=== Setting up a branch named ${branch}...\n"
cd ~/.equalizer cd ~/equalizer.git || exit 1
printf "=== Retrieving the latest data from the repository...\n" printf "=== Retrieving the latest data from the repository...\n"
git fetch --all git fetch --all || exit 1
printf "=== Creating the branch 'feature/${branch}' from develop_front and checking it out in a new working tree at ~/branches/${branch}...\n" printf "=== Creating the branch 'feature/${branch}' from develop_front and checking it out in a new working tree at ~/branches/${branch}...\n"
git worktree add -b "feature/${branch}" ~/branches/"${branch}" develop_front || git worktree add ~/branches/"${branch}" "feature/${branch}" git worktree add -b "feature/${branch}" ~/branches/"${branch}" develop_front || git worktree add ~/branches/"${branch}" "feature/${branch}" || exit 1
else else
printf "=== Accessing an existing branch named ${branch}...\n" printf "=== Accessing an existing branch named ${branch}...\n"
fi fi
cd ~/branches/"${branch}" cd ~/branches/"${branch}" || exit 1
update_branch update_branch || exit 1
printf "\a=== Your new branch ${branch} is ready!\n" printf "\a=== Your new branch ${branch} is ready!\n"
) && \ ) && \
cd ~/branches/"${branch}" cd ~/branches/"${branch}"
@ -37,9 +42,12 @@ function start_branch() {
function update_branch() { function update_branch() {
( (
set -o errexit
set -o nounset
set -o pipefail
printf "=== Updating the branch...\n" printf "=== Updating the branch...\n"
git fetch --all git fetch --all || exit 1
git pull --rebase git pull --rebase || exit 1
git rebase --interactive develop_front git rebase --interactive develop_front
printf "=== Updating the dependencies...\n" printf "=== Updating the dependencies...\n"
install_equalizer_deps install_equalizer_deps
@ -48,7 +56,9 @@ function update_branch() {
function install_equalizer_deps() { function install_equalizer_deps() {
( (
set -eu set -o errexit
set -o nounset
set -o pipefail
printf "Installing Ruby dependencies...\n" printf "Installing Ruby dependencies...\n"
bundle install bundle install
printf "Installing Javascript dependencies...\n" printf "Installing Javascript dependencies...\n"

Loading…
Cancel
Save