aboutsummaryrefslogtreecommitdiff
path: root/libexec/recit-setup
blob: 9189bcc70c1d7f17c5a8b25676240f853369721c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
# Usage: recit setup [force]
# Summary: Create a new recit database at $HOME/.recit.rec

set -e

if ! [[ "$1" = "force" ]]; then
  if [[ -f "$HOME/.recit.location" ]]; then
      recfile_location=$(cat "$HOME/.recit.location") 
      echo "looks like you already have recit set up at ${recfile_location}, aborting..."
      exit 1
  fi
fi

cat share/recit/recit.example.rec > "$HOME/.recit.rec"
echo "$HOME/.recit.rec" > "$HOME/.recit.location"