|
73 | 73 | fi |
74 | 74 |
|
75 | 75 | WEB_UI_DIR="${FLUTTER_DIR}/lib/web_ui" |
76 | | -DEV_DIR="${WEB_UI_DIR}/dev" |
77 | | -DART_TOOL_DIR="${WEB_UI_DIR}/.dart_tool" |
78 | 76 | DART_PATH="$DART_SDK_DIR/bin/dart" |
79 | | -SNAPSHOT_PATH="${DART_TOOL_DIR}/felt.snapshot" |
80 | | -STAMP_PATH="${DART_TOOL_DIR}/felt.snapshot.stamp" |
81 | | -SCRIPT_PATH="${DEV_DIR}/felt.dart" |
82 | | -REVISION="$(cd "$FLUTTER_DIR"; git rev-parse HEAD)" |
83 | 77 |
|
84 | 78 | if [[ "$FELT_DEBUG" == "true" || "$FELT_DEBUG" == "1" ]] |
85 | 79 | then |
@@ -133,28 +127,6 @@ then |
133 | 127 | set -e |
134 | 128 | fi |
135 | 129 |
|
136 | | -if [[ "$FELT_USE_SNAPSHOT" == "false" || "$FELT_USE_SNAPSHOT" == "0" ]]; then |
137 | | - echo "[Snapshot mode: off]" |
138 | | - # Running without snapshot means there is high likelihood of local changes. In |
139 | | - # that case, let's clear the snapshot to avoid any surprises. |
140 | | - rm -f "$SNAPSHOT_PATH" |
141 | | - rm -f "$STAMP_PATH" |
142 | | - install_deps |
143 | | - $DART_SDK_DIR/bin/dart $FELT_DEBUG_FLAGS "$DEV_DIR/felt.dart" $@ |
144 | | -else |
145 | | - # Create a new snapshot if any of the following is true: |
146 | | - # * SNAPSHOT_PATH is not a file, or |
147 | | - # * STAMP_PATH is not a file with nonzero size, or |
148 | | - # * Contents of STAMP_PATH is not our local git HEAD revision, or |
149 | | - # * pubspec.yaml last modified after pubspec.lock |
150 | | - if [[ ! -f $SNAPSHOT_PATH || ! -s "$STAMP_PATH" || "$(cat "$STAMP_PATH")" != "$REVISION" || "$WEB_UI_DIR/pubspec.yaml" -nt "$WEB_UI_DIR/pubspec.lock" ]]; then |
151 | | - echo "[Snapshot mode: on] (creating a new snapshot)" |
152 | | - install_deps |
153 | | - mkdir -p $DART_TOOL_DIR |
154 | | - |
155 | | - "$DART_SDK_DIR/bin/dart" --snapshot="$SNAPSHOT_PATH" --packages="$WEB_UI_DIR/.dart_tool/package_config.json" "$SCRIPT_PATH" |
156 | | - echo "$REVISION" > "$STAMP_PATH" |
157 | | - fi |
158 | | - |
159 | | - $DART_SDK_DIR/bin/dart $FELT_DEBUG_FLAGS --packages="$WEB_UI_DIR/.dart_tool/package_config.json" "$SNAPSHOT_PATH" $@ |
160 | | -fi |
| 130 | +cd $WEB_UI_DIR |
| 131 | +install_deps |
| 132 | +(cd $WEB_UI_DIR && $DART_SDK_DIR/bin/dart run $FELT_DEBUG_FLAGS dev/felt.dart $@) |
0 commit comments