forked from michaellee8/flutter_fuchsia_toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflutterfx
executable file
·73 lines (56 loc) · 1.42 KB
/
flutterfx
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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$DIR/config-common.sh"
if [[ "$1" == "bootstrap" ]];then
cd $DIR
git submodule init
cd fuchsia-cpp-gn-sdk && ./scripts/setup-and-test.sh && cd ../
./flutter/bin/flutter precache --fuchsia --all-platforms
exit
fi
if [[ "$1" == "dir" ]];then
echo $DIR
exit
fi
if [[ "$1" == "readme" ]];then
cd $DIR
less README.md
exit
fi
if [[ "$1" == "update" ]];then
cd $DIR
git submodule update --init --recursive
git pull
exit
fi
if [[ "$1" == "fuchsia" ]];then
"$DIR/fuchsia-cpp-gn-sdk/third_party/fuchsia-sdk/bin/$2.sh" "${@:3}"
exit
fi
if [[ "$1" == "flutter" ]];then
if [[ -n "$USE_MODIFIED_FLUTTER" ]]; then
PUB_CACHE="$DIR/.pub-cache" "$DIR/flutter/bin/cache/dart-sdk/bin/dart" \
"$DIR/flutter/packages/flutter_tools/bin/flutter_tools.dart" \
"${@:2}"
else
PUB_CACHE="$DIR/.pub-cache" "$DIR/flutter/bin/flutter" \
"${@:2}"
fi
exit
fi
show_help(){
cat << EOF
usage: flutterfx
bootstrap: init submodule and download required artifacts
update: update this repo and submodules
fuchsia <fserve|fpave|fserve-remote|fdevtools|fssh|fcp|femu|fpublish|fconfig|femu-exec-wrapper>: run <command> in the fuchsia sdk
flutter <command>: run <command> in the flutter sdk
readme: show the readme file
help: display this message
EOF
}
if [[ "$1" == "help" ]];then
show_help
exit
fi
show_help