diff options
author | Yaroslav <contact@yaroslavps.com> | 2020-06-15 00:28:32 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2020-06-15 00:28:32 +0300 |
commit | 2eec23a2c6b936d433ed396e3447f270290a7cb7 (patch) | |
tree | 53dc80ccef645e5bf2bd539ecb521621fa34cc59 | |
parent | bd98ceb916d838f144f9e6c55bfbb11f33ed906b (diff) | |
download | swayrice-2eec23a2c6b936d433ed396e3447f270290a7cb7.tar.gz swayrice-2eec23a2c6b936d433ed396e3447f270290a7cb7.zip |
script to start file from template
-rwxr-xr-x | dotfiles/.local/bin/ftv | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/ftv b/dotfiles/.local/bin/ftv new file mode 100755 index 0000000..4b79083 --- /dev/null +++ b/dotfiles/.local/bin/ftv @@ -0,0 +1,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 |