-
Notifications
You must be signed in to change notification settings - Fork 2
/
sw
executable file
·83 lines (66 loc) · 1.14 KB
/
sw
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
80
81
82
83
#!/usr/bin/env bash
#
# Copyright (C) 2019 Saalim Quadri (danascape)
#
# SPDX-License-Identifier: Apache-2.0 license
#
SWORKFLOW=${SWORKFLOW:-'sw'}
# Global Paths
# SW source directory
if [[ -f '/usr/bin/sw' ]]; then
SW_SRC_DIR="/usr/share/sw"
elif [[ -f $HOME/sworkflow/sw ]]; then
SW_SRC_DIR="$HOME/sworkflow"
else
# SW_SRC_DIR="${SW_SRC_DIR:-"$HOME/.local/sw"}/${SWORKFLOW}"
SW_SRC_DIR="$HOME/.local/sw"
fi
sw()
{
argument="$1"
case "$argument" in
build | b)
(
. "$SW_SRC_DIR"/src/build.sh --source-only
kernel_build '' "$@"
)
;;
init | i)
(
. "$SW_SRC_DIR"/src/init.sh --source-only
generate_config
)
;;
help | h)
(
. "$SW_SRC_DIR"/src/help.sh --source-only
sworkflow_help
)
;;
man | m)
(
. "$SW_SRC_DIR"/src/help.sh --source-only
sworkflow_help
)
;;
pack | p)
(
. "$SW_SRC_DIR"/src/sw_package.sh --source-only
kernel_package '' "$@"
)
;;
version | v)
(
. "$SW_SRC_DIR"/src/version.sh --source-only
sworkflow_version
)
;;
*)
(
. "$SW_SRC_DIR"/src/help.sh --source-only
sworkflow_help
)
;;
esac
}
sw "$@"