From f96b2d6c0c145dba830a378a5ce29863e1ba55d2 Mon Sep 17 00:00:00 2001 From: oasido Date: Tue, 11 Jun 2024 00:56:01 +0300 Subject: [PATCH] update through script - 2024-06-11 00:56:01 --- .bashrc | 1 + .local/bin/scripts/backup | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.bashrc b/.bashrc index 267e5d9..0e88a0b 100644 --- a/.bashrc +++ b/.bashrc @@ -4,6 +4,7 @@ export PERSONAL="$HOME/personal" export SECOND_BRAIN="$HOME/sb" export WORK="$HOME/work" export UNI="$HOME/uni" +export NEOVIM_DIR="$HOME/.config/nvim" export STARTUP="$HOME/.config/autostart" export NVM_DIR="$HOME/.nvm" export GO="/usr/local/go/bin" diff --git a/.local/bin/scripts/backup b/.local/bin/scripts/backup index 74a557c..1ad8fb1 100755 --- a/.local/bin/scripts/backup +++ b/.local/bin/scripts/backup @@ -4,25 +4,32 @@ set -e timestamp=$(date +"%Y-%m-%d %H:%M:%S") dot() { - git -C "$DOTFILES" add . - git -C "$DOTFILES" commit -m "update through script - $timestamp" - git -C "$DOTFILES" push + git -C "$DOTFILES" add . + git -C "$DOTFILES" commit -m "update through script - $timestamp" + git -C "$DOTFILES" push echo "$DOTFILES comitted" } sb() { - git -C "$SECOND_BRAIN" add . - git -C "$SECOND_BRAIN" commit -m "update through script - $timestamp" - git -C "$SECOND_BRAIN" push + git -C "$SECOND_BRAIN" add . + git -C "$SECOND_BRAIN" commit -m "update through script - $timestamp" + git -C "$SECOND_BRAIN" push echo "$SECOND_BRAIN comitted" } +nvim() { + git -C "$NVIM_DIR" add . + git -C "$NVIM_DIR" commit -m "update through script - $timestamp" + git -C "$NVIM_DIR" push + echo "$NVIM_DIR comitted" +} + case "$1" in -dot | sb) +dot | sb | nvim) $1 ;; *) - echo "valid commands: dot, sb" >&2 + echo "valid commands: dot, sb, nvim" >&2 exit 1 ;; esac