Skip to content

Instantly share code, notes, and snippets.

@stephenajulu
Forked from cybertramp/commit.sh
Created July 25, 2020 19:38
Show Gist options
  • Select an option

  • Save stephenajulu/110b6206546b59c616c20f8e193c0c97 to your computer and use it in GitHub Desktop.

Select an option

Save stephenajulu/110b6206546b59c616c20f8e193c0c97 to your computer and use it in GitHub Desktop.

Revisions

  1. @cybertramp cybertramp created this gist Sep 23, 2019.
    21 changes: 21 additions & 0 deletions commit.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #! /bin/bash

    # =============================
    #
    # Hugo fast commit script
    #
    # Created 19.09.23([email protected])
    #
    # =============================

    hugo_path=`dirname $PWD`/hugo
    var_date=`date +%F`
    external_dir=`../blog/`
    echo "Start commit"

    ${hugo_path}
    rm -rf ${external_dir}*
    cp -rf public/* ${external_dir}
    git -C ${external_dir}. add .
    git -C ${external_dir}. commit -m "${var_date}"
    git -C ${external_dir}. push origin +master
    18 changes: 18 additions & 0 deletions write.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #! /bin/bash

    # =============================
    #
    # Hugo fast write script
    #
    # Created 19.09.23([email protected])
    #
    # =============================
    ## Hugo located under dirctory(../hugo)

    hugo_path=`dirname $PWD`/hugo
    now_date=`date +%F`

    echo "Please input filename"
    read input

    ${hugo_path} new post/${now_date}-${input}.md