refactor: move into a website directory
This commit is contained in:
parent
86529d7148
commit
3c5c0e808a
747 changed files with 133 additions and 2 deletions
21
website/drafts
Executable file
21
website/drafts
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
readonly DRAFTS_DIR="${HOME}/Code/Personal/oliverdavies.uk/source/_posts"
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
grep -lr "draft: true" "${DRAFTS_DIR}" | cut -d"/" -f9- | tr ".md" "" | sort
|
||||
exit 0
|
||||
fi
|
||||
|
||||
readonly DRAFTS_FILE="${*}.md"
|
||||
readonly DRAFTS_PATH="${DRAFTS_DIR}/${DRAFTS_FILE// /-}"
|
||||
|
||||
echo $DRAFTS_PATH
|
||||
if [[ -e "${DRAFTS_PATH}" ]]; then
|
||||
eval "${EDITOR}" "${DRAFTS_PATH}"
|
||||
else
|
||||
touch "${DRAFTS_PATH}"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue