Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use flutter.bat on windows #386

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lua/flutter-tools/executable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,16 @@ local function path_from_lookup_cmd(lookup_cmd, callback)
job:start()
end

local function _flutter_executable_name()
if path.isWindows then return "flutter.bat" end
return "flutter"
end

local function _flutter_bin_from_fvm()
local fvm_root =
fs.dirname(fs.find(".fvm", { path = luv.cwd(), upward = true, type = "directory" })[1])
local flutter_bin_symlink = path.join(fvm_root, ".fvm", "flutter_sdk", "bin", "flutter")
local flutter_bin_symlink =
path.join(fvm_root, ".fvm", "flutter_sdk", "bin", _flutter_executable_name())
local flutter_bin = luv.fs_realpath(flutter_bin_symlink)
if path.exists(flutter_bin_symlink) and path.exists(flutter_bin) then return flutter_bin end
end
Expand All @@ -118,7 +124,6 @@ function M.get(callback)
_paths = {
flutter_bin = flutter_bin,
flutter_sdk = _flutter_sdk_root(flutter_bin),
fvm = true,
}
_paths.dart_sdk = _dart_sdk_root(_paths)
_paths.dart_bin = _flutter_sdk_dart_bin(_paths.flutter_sdk)
Expand Down
Loading