-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathzprofile
More file actions
147 lines (119 loc) · 3.14 KB
/
zprofile
File metadata and controls
147 lines (119 loc) · 3.14 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# -*- mode: sh; coding: utf-8; -*-
# vim:set filetype=sh fileencoding=utf-8:
#
# Executes commands at login pre-zshrc.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# Browser
#
if [[ -z "$BROWSER" && "$OSTYPE" == darwin* ]]; then
export BROWSER='open'
fi
#
# Editors
#
if [[ -z "$EDITOR" ]]; then
export EDITOR='vim'
fi
if [[ -z "$VISUAL" ]]; then
export VISUAL='vim'
fi
if [[ -z "$PAGER" ]]; then
export PAGER='less'
fi
#
# Language
#
if [[ -z "$LANG" ]]; then
export LANG='en_US.UTF-8'
fi
#
# Paths
#
# Ensure path arrays do not contain duplicates.
typeset -gU cdpath fpath mailpath path
# Set the list of directories that cd searches.
# cdpath=(
# $cdpath
# )
# Set the list of directories that Zsh searches for programs.
path=(
$HOME/{,s}bin(N)
/opt/{homebrew,local}/{,s}bin(N)
/usr/local/{,s}bin(N)
$path
)
#
# Less
#
# Set the default Less options.
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
# Remove -X to enable it.
if [[ -z "$LESS" ]]; then
export LESS='-g -i -M -R -S -w -z-4'
fi
# Set the Less input preprocessor.
# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system.
if [[ -z "$LESSOPEN" ]] && (( $#commands[(i)lesspipe(|.sh)] )); then
# export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-"
export LESSOPEN='| ~/.lessfilter %s 2>&-'
fi
#
# Setting XDG Home
#
# Should be $HOME/.config on linux by default.
# This is a fix for some apps, e.g. lazygit. See: https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md
if [[ "$OSTYPE" == darwin* ]]; then
export XDG_CONFIG_HOME="$HOME/.config"
fi
#
# Sience homebrew hints
#
if command -v brew > /dev/null; then
export HOMEBREW_NO_ENV_HINTS=1
fi
#
# Export certificate bundle file
#
if [ -f /etc/ssl/certs/ca-certificates.crt ]; then
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
fi
if [ -d $HOME/.ssl ]; then
export SSL_CERT_FILE="$HOME/.ssl/allCAbundle.pem"
export REQUESTS_CA_BUNDLE="$SSL_CERT_FILE"
fi
#
# Java
#
if command -v brew > /dev/null; then
if [[ -d $(brew --prefix)/opt/openjdk@17 ]]; then
export JAVA_HOME=$(brew --prefix)/opt/openjdk@17
if [[ "$OSTYPE" == darwin* ]]; then
export JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStoreType=KeychainStore"
export SPARK_LOCAL_HOSTNAME="localhost"
fi
fi
elif [[ -d /usr/lib/jvm/java-11-openjdk-amd64 ]]; then
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
fi
export PATH="$JAVA_HOME/bin:$PATH"
#
# Liquibase
#
if command -v liquibase > /dev/null; then
[[ "$OSTYPE" == darwin* ]] && export LIQUIBASE_HOME=$(brew --prefix)/opt/liquibase/libexec
export JAVA_OPTS=--add-opens=java.base/java.nio=ALL-UNNAMED
fi
#
# Rancher
#
if [[ -d $HOME/.rd/bin ]]; then
export PATH="$HOME/.rd/bin:$PATH"
export DOCKER_HOST=unix://$HOME/.rd/docker.sock
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
# from: https://github.com/rancher-sandbox/rancher-desktop/issues/2609#issuecomment-2639766889
export TESTCONTAINERS_HOST_OVERRIDE=$(ifconfig $(route -n get 0.0.0.0 | grep -F interface | cut -d: -f2) | awk '/inet / {print $2}')
fi