File: generate-dummy-install.sh

package info (click to toggle)
vit 2.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,012 kB
  • sloc: python: 5,028; sh: 103; makefile: 4
file content (49 lines) | stat: -rwxr-xr-x 1,028 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh

set -e
set -u

TMP_DIR="$(mktemp --directory --suffix .vit)"
VIT_DIR="$TMP_DIR/vit"
TASK_DIR="$TMP_DIR/task"
TASKRC="$TMP_DIR/taskrc"

echo "
This script will create a dummy TaskWarrior database and VIT configuration.
"
read -p "Press enter to continue... " DUMMY

echo "Creating dummy task configuration..."
mkdir "$TASK_DIR"
cat > "$TASKRC" <<EOT
data.location=$TASK_DIR
EOT
export TASKRC

echo "Creating dummy VIT configuration..."
mkdir "$VIT_DIR"
touch "$VIT_DIR/config.ini"

echo "Adding some dummy tasks..."
task add a
task add b
task +LATEST start
task add c
task +LATEST start
task +LATEST modify project:foo

echo "Complete!

Copy and paste the following two export statements into your current
shell sesison to activate the dummy installation.

export TASKRC=${TASKRC}
export VIT_DIR=${VIT_DIR}

When complete, you can simply exit the current shell session, or copy and paste
the following 'unset' commands to revert the current shell session to the
TaskWarrior/VIT defaults.

unset TASKRC
unset VIT_DIR
"