-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathta3_search_windows
80 lines (66 loc) · 1.97 KB
/
ta3_search_windows
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
75
76
77
78
79
#! /usr/bin/env bash
# A copy of ta3_search, but has some special commands for windows.
# Should eventually be merged into ta3_search, with checks for the operating system.
function pkill(){
wmic Path win32_process Where "CommandLine Like '%$2%'" Call Terminate
}
cleanup()
# example cleanup function
{
pkill -P $$
}
control_c()
# run if user hits control-c
{
echo -en "\n*** Ouch! Exiting ***\n"
cleanup
exit $?
}
# trap keyboard interrupt (control-c)
trap control_c INT
#trap "exit" SIGINT SIGTERM
# Check if there is an argument, and if it exists, then we load config from there.
touch node_middleware/tufts_gt_wisc_configuration.json
if [ -n "$1" ]; then
if [[ $1 == dataset:* ]]; then
echo "using tinyconf"
else
if [ -e "$1" ]; then
cat "$1" > node_middleware/tufts_gt_wisc_configuration.json
else
echo "No file found at $1, falling back to 'tufts_gt_wisc_configuration.json'"
fi
fi
else
# check if $CONFIG_JSON_PATH really exists, otherwise don't overwrite
# tufts_gt_wisc_configuration.json
if [ -e "$CONFIG_JSON_PATH" ]; then
echo "using config file: $CONFIG_JSON_PATH"
cat "$CONFIG_JSON_PATH" > node_middleware/tufts_gt_wisc_configuration.json
else
echo "No config file specified, falling back to 'tufts_gt_wisc_configuration.json'"
fi
fi
# First, we copy CONFIG_JSON_PATH into tufts_gt_wisc_configuration.json
# Then, we start the node server
echo server_starting
if [[ $1 == dataset:* ]]; then
echo "running middleware with dataset"
cd node_middleware && npm run server $1 &
else
echo "running middleware without dataset"
cd node_middleware && npm run server &
fi
# Then, we start the dev server
#echo dev
if [ -z "$2" ]; then
echo "running frontend without second arg"
cd vue_frontend && npm run dev
else
echo "running frontend with second arg"
cd vue_frontend && npm run dev --public "$2"
fi
# When the node server dies, we kill this process.
cleanup
# echo starting
# echo done