-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathserver
More file actions
executable file
·48 lines (38 loc) · 848 Bytes
/
Copy pathserver
File metadata and controls
executable file
·48 lines (38 loc) · 848 Bytes
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
#!/bin/bash
#/ NAME
#/ server -- runs geminabox
#/
#/ SYNOPSIS
#/ server gem
# figure out the project root under which bin, lib live
shome="$(cd -P -- "$(dirname -- "$0")/.." && pwd -P)"
# load a meat library
source "$shome/libexec/_jason" "$@"
# entry point
function main {
nm_component="$1"; shift
case "$nm_component" in
gem)
server_gem "$@"
;;
*)
logger_fatal "don't know how to run ${nm_component}"
exit 1
;;
esac
}
# run geminabox
function server_gem {
exec rackup "$shome/config/config.ru"
}
# define command line options:
# var name, default, description, short option
# parse the command-line
parse_command_line "$@" || exit $?
eval set -- "${FLAGS_ARGV}"
if [[ "$#" < 1 ]]; then
logger_fatal "missing component(s)"
exit 1
fi
# pass arguments to entry point
main "$@"