forked from serverpod/serverpod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpub_get_all
executable file
·85 lines (77 loc) · 2.48 KB
/
pub_get_all
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
#!/bin/bash
if [ ! -f util/.serverpod_util_root ]; then
echo "Run this script from the root of the Serverpod repository"
echo "I.e. util/pub_get_all"
exit 1
fi
set -e
BASE=$(pwd)
OFFLINE_MODE=""
PUB_MODE="upgrade"
for arg in "$@"
do
# Check for --offline parameter
if [ "$arg" == "--offline" ]; then
OFFLINE_MODE="--offline"
echo "Running in offline mode"
elif [ "$arg" == "--downgrade" ]; then
PUB_MODE="downgrade"
echo "Running in downgrade mode"
fi
done
echo "PUB UPGRADE ALL"
declare -a dart_paths=(
"packages/serverpod"
"examples/auth_example/auth_example_client"
"examples/auth_example/auth_example_server"
"examples/chat/chat_client"
"examples/chat/chat_server"
"packages/serverpod_client"
"packages/serverpod_serialization"
"packages/serverpod_service_client"
"packages/serverpod_shared"
"packages/serverpod_test"
"tests/serverpod_test_client"
"tests/serverpod_test_server"
"tests/serverpod_test_shared"
"tests/serverpod_test_module/serverpod_test_module_client"
"tests/serverpod_test_module/serverpod_test_module_server"
"tests/bootstrap_project"
"tests/serverpod_cli_e2e_test"
"templates/serverpod_templates/projectname_server"
"templates/serverpod_templates/projectname_client"
"templates/serverpod_templates/modulename_server"
"templates/serverpod_templates/modulename_client"
"modules/serverpod_auth/serverpod_auth_server"
"modules/serverpod_auth/serverpod_auth_client"
"modules/serverpod_chat/serverpod_chat_server"
"modules/serverpod_chat/serverpod_chat_client"
"integrations/serverpod_cloud_storage_s3"
"integrations/serverpod_cloud_storage_gcp"
"tools/serverpod_cli"
)
declare -a flutter_paths=(
"examples/auth_example/auth_example_flutter"
"examples/chat/chat_flutter"
"packages/serverpod_flutter"
"templates/serverpod_templates/projectname_flutter"
"modules/serverpod_auth/serverpod_auth_shared_flutter"
"modules/serverpod_auth/serverpod_auth_apple_flutter"
"modules/serverpod_auth/serverpod_auth_google_flutter"
"modules/serverpod_auth/serverpod_auth_email_flutter"
"modules/serverpod_auth/serverpod_auth_firebase_flutter"
"modules/serverpod_chat/serverpod_chat_flutter"
"tests/serverpod_test_flutter"
)
# Upgrade Dart packages
for path in "${dart_paths[@]}"; do
echo "\n### $path"
cd "$BASE/$path"
dart pub $PUB_MODE $OFFLINE_MODE
done
# Upgrade Flutter packages
for path in "${flutter_paths[@]}"; do
echo "\n### $path"
cd "$BASE/$path"
flutter pub $PUB_MODE $OFFLINE_MODE
done