forked from emmercm/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.20_pulsar.bash
executable file
·48 lines (38 loc) · 1.3 KB
/
.20_pulsar.bash
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
# @see https://archive.apache.org/dist/pulsar/
: "${PULSAR_STANDALONE_DIR:=${HOME}/Downloads/apache-pulsar-3.0.0}"
if [[ -d "${PULSAR_STANDALONE_DIR}" ]]; then
if [[ -f "${PULSAR_STANDALONE_DIR}/pulsar-admin" ]]; then
PULSAR_STANDALONE_DIR=${PULSAR_STANDALONE_DIR}/..
fi
export PATH="${PATH}:${PULSAR_STANDALONE_DIR}/bin"
fi
__pulsar_jre() {
pulsar-shell() {
if [[ -x /usr/libexec/java_home ]]; then
# We need JRE v17+ for class file v61.0+
# shellcheck disable=SC2034
JAVA_HOME=$(/usr/libexec/java_home -v 17 2> /dev/null)
fi
command pulsar-shell "$@"
}
}
__pulsar_jre
__pulsar_admin() {
# pulsar-admin() {
# command pulsar-admin \
# ${PULSAR_ADMIN_URL:+--admin-url "${PULSAR_ADMIN_URL}"} \
# ${PULSAR_AUTH_PARAMS:+--auth-params "${PULSAR_AUTH_PARAMS}"} \
# ${PULSAR_AUTH_PLUGIN:+--auth-plugin "${PULSAR_AUTH_PLUGIN}"} \
# "$@"
# }
alias pclusters="pulsar-admin clusters list"
alias pc=pclusters
alias pnamespaces="pulsar-admin namespaces list"
alias pn=pnamespaces
alias pshell=pulsar-shell
alias ptenants="pulsar-admin tenants list"
alias pt=ptenants
alias ptopics="pulsar-admin topics list"
alias pt=ptopics
}
__pulsar_admin