Skip to content

Commit 6d0c1e5

Browse files
committed
feat: can directly specify the path of sdk
1 parent d135e1d commit 6d0c1e5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lua/flutter-tools/executable.lua

+9-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,16 @@ function M.get(callback)
126126
end
127127
end
128128

129+
local flutter_sdk_path = nil
130+
if config.flutter_sdk_path then flutter_sdk_path = config.flutter_sdk_path end
131+
129132
if config.flutter_path then
130-
local flutter_path = fn.resolve(config.flutter_path)
131-
_paths = { flutter_bin = flutter_path, flutter_sdk = _flutter_sdk_root(flutter_path) }
133+
local flutter_path = config.flutter_path
134+
local flutter_path_real_try = fn.resolve(flutter_path)
135+
_paths = {
136+
flutter_bin = flutter_path,
137+
flutter_sdk = flutter_sdk_path or _flutter_sdk_root(flutter_path_real_try),
138+
}
132139
_paths.dart_sdk = _dart_sdk_root(_paths)
133140
_paths.dart_bin = _flutter_sdk_dart_bin(_paths.flutter_sdk)
134141
return callback(_paths)

0 commit comments

Comments
 (0)