-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.envrc
97 lines (73 loc) · 2.68 KB
/
.envrc
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
#!/bin/env zsh
#
# Commands and shortcuts for Meteor core development, you can load these in your terminal by running `source .envrc`.
# Or by adding `[[ -s .envrc ]] && source .envrc` to your `.zshrc` or `.bashrc`.
#
export ROOT_DIR=$(git rev-parse --show-toplevel)
########
# Core #
########
function @meteor {
"$ROOT_DIR/meteor" "$@"
}
function @get-ready {
@meteor --get-ready
}
function @test-packages {
TINYTEST_FILTER="$1" @meteor test-packages --exclude-archs=web.browser.legacy,web.cordova
}
function @test-self {
@meteor self-test "$@"
}
function @test-in-console {
"$ROOT_DIR/packages/test-in-console/run.sh" "$@"
}
function @check-syntax {
node "$ROOT_DIR/scripts/admin/check-legacy-syntax/check-syntax.js"
}
function @generate-dev-bundle {
rm -rf $ROOT_DIR/dev_bundle*
"$ROOT_DIR/scripts/generate-dev-bundle.sh"
}
function @init-submodule {
git submodule update --init --recursive
}
#################
# Documentation #
#################
function @docs-start {
npm run docs:dev --prefix "$ROOT_DIR/v3-docs/docs"
}
function @docs-migration-start {
npm run docs:dev --prefix "$ROOT_DIR/v3-docs/v3-migration-docs"
}
function @packages-bumped {
git diff --name-only devel...$(git branch --show-current) | grep "packages/.*/package.js$" | while IFS= read -r file; do
if ! git show devel:$file > /dev/null 2>&1; then
continue
fi
old=$(git show devel:$file | grep -o "version: *['\"][^'\"]*['\"]" | sed "s/version: *.['\"]//;s/['\"].*//")
version=$(grep -o "version: *['\"][^'\"]*['\"]" "$file" | sed "s/version: *.['\"]//;s/['\"].*//")
name=$(grep -o "name: *['\"][^'\"]*['\"]" "$file" | sed "s/name: *.['\"]//;s/['\"].*//")
pkg_name=$(echo "$file" | sed -E 's|packages/([^/]*/)?([^/]*)/package\.js|\2|')
version_in_red=$(tput setaf 1)$version$(tput sgr0)
if [[ "$version" != "$old" ]]; then
echo "- $pkg_name@$version_in_red"
fi
done
}
function @packages-bumped-npm {
git diff --name-only devel...$(git branch --show-current) | grep "npm-packages/.*/package.json$" | while IFS= read -r file; do
if ! git show devel:$file > /dev/null 2>&1; then
continue
fi
old=$(git show devel:$file | grep -o "version: *['\"][^'\"]*['\"]" | sed "s/version: *.['\"]//;s/['\"].*//")
version=$(grep -o "\"version\": *['\"][^'\"]*['\"]" "$file" | sed "s/\"version\": *.['\"]//;s/['\"].*//")
name=$(grep -o "\"name\": *['\"][^'\"]*['\"]" "$file" | sed "s/\"name\": *.['\"]//;s/['\"].*//")
pkg_name=$(echo "$file" | sed -E 's|npm-packages/([^/]*/)?([^/]*)/package\.json|\2|')
version_in_red=$(tput setaf 1)$version$(tput sgr0)
if [[ "$version" != "$old" ]]; then
echo "- $pkg_name@$version_in_red"
fi
done
}