From 294e95ad1bd3cb1f0cc4819bcbae137d02947464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Thu, 26 May 2022 20:27:59 +0300 Subject: [PATCH] Yet another life-saving script --- push_lectures.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 push_lectures.sh diff --git a/push_lectures.sh b/push_lectures.sh new file mode 100755 index 0000000..6c8e74b --- /dev/null +++ b/push_lectures.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# Ferit Yiğit BALABAN , 2022 +# +# Description +# This script is used to push all changes in lecture notes folder to GitHub + +steps=6 +notes="$HOME/notes/001_Education" +attch="$HOME/notes/009_Attachments" +atinn="$HOME/notes/001_Education/009_Attachments" +cmssg="$( date +"%d/%m/%y-%H.%M.%S" )" +echo "[1/$steps] Copy attachments to notes Git repository" +cp -r $attch $notes +echo "[2/$steps] Switch directory to $notes" +cd $notes +echo "[3/$steps] Add all changes to staging" +git add --all . +echo "[4/$steps] Commit changes" +git commit -m $cmssg +echo "[5/$steps] Push changes to remote" +git push origin main +echo "[6/$steps] Remove attachments from notes Git repository" +rm -r $atinn