-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodoConsole
executable file
·74 lines (57 loc) · 1.51 KB
/
todoConsole
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/zsh
function clearScreen() {
# CLEAR SCREEN AND SET CURSOR ON TOP
echo "\x1b[2J"
echo "\x1b[H"
echo "\x1b[3A"
}
function init() {
cd /Users/diegoibarra/Developer/1_myProjects/Apps/ToDo
echo "\n---------------------------">>resources/cache/diegoibarra.todo.err
date +%m-%d>>resources/cache/diegoibarra.todo.err
echo "\n---------------------------" >> resources/cache/diegoibarra.todo.out
date +%m-%d >> resources/cache/diegoibarra.todo.out
ITEM_LIST=()
LOOP=true
HEIGHT=$(tput lines)
clearScreen
# CHANGE FONT COLOR
echo "\x1b[1A\x1b[38;5;244m Task - Date"
echo "\x1b[1A\x1b[38;5;202m"
}
function showTasks() {
clearScreen
task_str=$(sed 's/,/ - /' TaskList.csv)
echo $task_str
echo "\x1b[${HEIGHT}B"
read -q "CONTINUE?Continue? (enter: no; y: yes): "
if [[ "$CONTINUE" == "y" ]]; then
clearScreen
fi
if [[ "$CONTINUE" == "n" ]]; then
clearScreen
exit
fi
}
####################################################################
init
while true; do
read "INPUT?: "
case "${INPUT}" in
"" | " " | "q" | "quit" | "-q" | "-quit" )
break
;;
"list" | "l" | "-list" | "-l" )
showTasks;
;;
"update" )
ITEM_LIST="update"
;;
* )
ITEM_LIST+=($INPUT)
;;
esac
done
nohup python3 makeTasks.py $ITEM_LIST >>resources/cache/diegoibarra.todo.out 2>>resources/cache/diegoibarra.todo.err &
echo "\x1b[0m"
exit