Skip to content

Commit

Permalink
feat: can directly specify the path of sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Dec 28, 2024
1 parent 54314bc commit af8969a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lua/flutter-tools/executable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,16 @@ function M.get(callback)
end
end

local flutter_sdk_path = nil
if config.flutter_sdk then flutter_sdk_path = flutter_sdk_path end

if config.flutter_path then
local flutter_path = fn.resolve(config.flutter_path)
_paths = { flutter_bin = flutter_path, flutter_sdk = _flutter_sdk_root(flutter_path) }
local flutter_path = config.flutter_path
local flutter_path_real_try = fn.resolve(flutter_path)
_paths = {
flutter_bin = flutter_path,
flutter_sdk = flutter_path or _flutter_sdk_root(flutter_path_real_try),
}
_paths.dart_sdk = _dart_sdk_root(_paths)
_paths.dart_bin = _flutter_sdk_dart_bin(_paths.flutter_sdk)
return callback(_paths)
Expand Down

0 comments on commit af8969a

Please sign in to comment.