#!/usr/bin/env bash# Copyright 2014 The Flutter Authors. All rights reserved.# Use of this source code is governed by a BSD-style license that can be# found in the LICENSE file.# ---------------------------------- NOTE ---------------------------------- ### Please keep the logic in this file consistent with the logic in the# `flutter-dev.bat` script in the same directory to ensure that Flutter# continues to work across all platforms!## -------------------------------------------------------------------------- #set -e# This is a helper script for development purposes. It runs the Flutter tool# from source code directly, without using the prebuilt snapshot. This is# useful for development, as it allows you to make changes to the tool and see# the effects immediately, but is much slower than using the prebuilt snapshot.# To debug the tool, you can uncomment the following lines to enable debug# mode and set a VM service port:# FLUTTER_TOOL_ARGS="--enable-asserts $FLUTTER_TOOL_ARGS"# FLUTTER_TOOL_ARGS="$FLUTTER_TOOL_ARGS --observe=65432"# Needed because if it is set, cd may print the path it changed to.unset CDPATH# On Mac OS, readlink -f doesn't work, so follow_links traverses the path one# link at a time, and then cds into the link destination and find out where it# ends up.## The returned filesystem path must be a format usable by Dart's URI parser,# since the Dart command line tool treats its argument as a file URI, not a# filename. For instance, multiple consecutive slashes should be reduced to a# single slash, since double-slashes indicate a URI "authority", and these are# supposed to be filenames. There is an edge case where this will return# multiple slashes: when the input resolves to the root directory. However, if# that were the case, we wouldn't be running this shell, so we don't do anything# about it.## The function is enclosed in a subshell to avoid changing the working directory# of the caller.function follow_links() (cd -P -- "$(dirname -- "1ドル")"file="$PWD/$(basename -- "1ドル")"while [[ -h "$file" ]]; docd -P -- "$(dirname -- "$file")"file="$(readlink -- "$file")"cd -P -- "$(dirname -- "$file")"file="$PWD/$(basename -- "$file")"doneecho "$file")# Lookup the parent directory of the script (../), the Flutter SDK root.PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")"BIN_DIR="$(cd -P -- "${PROG_NAME%/*}" ; pwd -P)"SHARED_NAME="$BIN_DIR/internal/shared.sh"FLUTTER_ROOT="$(cd -P -- "$BIN_DIR/.." ; pwd -P)"OS="$(uname -s)"# If we're on Windows, invoke the batch script instead to get proper locking.if [[ $OS =~ MINGW.* || $OS =~ CYGWIN.* || $OS =~ MSYS.* ]]; thenexec "${BIN_DIR}/flutter-dev.bat" "$@"fi# To define `shared::execute()` functionsource "$SHARED_NAME"# Run the Flutter tool directly without using the cached snapshot.shared::execute "$@"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。