-
Notifications
You must be signed in to change notification settings - Fork 0
/
sw
executable file
·70 lines (55 loc) · 985 Bytes
/
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
#!/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 '' "$@"
)
;;
help | h)
(
. $SW_SRC_DIR/src/help.sh --source-only
sworkflow_help
)
;;
man | m)
(
. $SW_SRC_DIR/src/help.sh --source-only
sworkflow_help
)
;;
version | v)
(
. $SW_SRC_DIR/src/version.sh --source-only
sworkflow_version
)
;;
*)
(
echo "error: Invalid Option"
. $SW_SRC_DIR/src/help.sh --source-only
sworkflow_help
)
;;
esac
}
sw "$@"