aboutsummaryrefslogtreecommitdiff
path: root/libexec/recit-setup
blob: bc8ddf744a83659910dd9ea7cb45338fd062f50b (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 "$_RECIT_ROOT/share/recit/recit.example.rec" > "$HOME/.recit.rec"
echo "$HOME/.recit.rec" > "$HOME/.recit.location"