aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/ftv
blob: 4b790831ffd79548aa0f431444f2642ad376b15f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# Script to start a new textfile from template

templdir=$HOME"/docs/templates/"

if [ -z "$2" ]; then
  echo "Specify template filename and new filename"
  exit 0
fi

template="$templdir$1"
file=$(readlink -f "$2")

if [ ! -f "$template" ]; then
  echo "Template $1 does not exist"
  exit 0
fi

cp $template $file
nvim $file