dotfiles

config files for my linux setup
git clone git://edryd.org/dotfiles
Log | Files | Refs

commit 7ea5c0d776d5138cdb9673f62d1c383735e3ac41
parent 31c2d9b70529b3a69c4083b4465ec0e80faa1bf8
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Thu, 19 Apr 2018 21:20:40 -0700

bin: Replace jpub with pub

Diffstat:
bin/jpub | 6------
bin/pub | 17+++++++++++++++++
2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/bin/jpub b/bin/jpub @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -date=$(date +"%Y-%m-%d") -file=$(basename "$1") - -mv "$1" _posts/"$date"-"$file" diff --git a/bin/pub b/bin/pub @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# pub: prepare post to be published +# +# Moves given draft into the posts directory and prefixes the filename with the +# date so that it is ready to be published. + +if [[ $# == 0 || $# > 2 || ! -f "$1" ]]; then + echo "usage: pub FILE [POSTDIR]" + exit 1 +fi + +date=$(date +"%Y-%m-%d") +file=$(basename "$1") +postsdir=${2:-_posts} + +mv "$1" "$postsdir"/"$date"-"$file"