-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.envrc
More file actions
68 lines (56 loc) · 1.52 KB
/
Copy path.envrc
File metadata and controls
68 lines (56 loc) · 1.52 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
PATH_add bin
export EXPO_ROOT_DIR=`pwd`
# ANDROID_HOME should be replaced with ANDROID_SDK_ROOT as soon as RN stops using it for its buildscripts
export ANDROID_HOME="${ANDROID_SDK_ROOT:=$ANDROID_SDK}"
# Force all Expo modules to be compiled from source
export EXPO_USE_SOURCE=1
# Setup ccache dir to normalize paths
export CCACHE_BASEDIR=`pwd`
source_local() {
file=./.envrc.local
if [[ -f "$file" ]]; then
source_env "$file"
fi
watch_file "$file"
}
source_secrets() {
file=$1
if [[ -f "$file" ]] && head -1 "$file" | grep --quiet "#!"; then
source_env "$file"
fi
watch_file "$file"
}
install_git_hooks() {
for path in scripts/git-hooks/*; do
filename=$(basename $path)
ln -sf "../../scripts/git-hooks/$filename" ".git/hooks/$filename"
done
}
apply_git_settings() {
if [[ -z "$(git config --local --get core.untrackedCache)" ]]; then
git config --local core.untrackedCache true
fi
if [[ -z "$(git config --local --get core.fsmonitor)" ]]; then
git config --local core.fsmonitor true
fi
}
use_ruby() {
local allowed_versions=$@
local pass=0
for version in $allowed_versions; do
if ruby -v | grep -q "ruby $version"; then
pass=1
fi
done
if [[ "$pass" == "0" ]]; then
log_error "Ruby version must be one of $allowed_versions. Please install it using your Ruby version manager like rbenv or rvm."
exit 1
fi
layout ruby
}
source_secrets secrets/expotools.env
source_local
install_git_hooks
apply_git_settings
use_ruby "3.3" "3.4" "4.0"
dotenv_if_exists .env