mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[reland] Adding vscode path installed via snap (#81989)
This commit is contained in:
parent
38840b41a9
commit
0d50604a56
@ -239,6 +239,7 @@ class VsCode {
|
||||
|
||||
// Linux:
|
||||
// /usr/share/code/bin/code
|
||||
// /snap/code/current
|
||||
// /usr/share/code-insiders/bin/code-insiders
|
||||
// Linux Extensions:
|
||||
// $HOME/.vscode/extensions
|
||||
@ -246,6 +247,7 @@ class VsCode {
|
||||
static List<VsCode> _installedLinux(FileSystem fileSystem, Platform platform) {
|
||||
return _findInstalled(<VsCodeInstallLocation>[
|
||||
const VsCodeInstallLocation('/usr/share/code', '.vscode'),
|
||||
const VsCodeInstallLocation('/snap/code/current', '.vscode'),
|
||||
const VsCodeInstallLocation(
|
||||
'/usr/share/code-insiders',
|
||||
'.vscode-insiders',
|
||||
|
||||
@ -41,6 +41,19 @@ void main() {
|
||||
expect(vsCode.version, Version.unknown);
|
||||
});
|
||||
|
||||
testWithoutContext('can locate VS Code installed via Snap', () {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
const String home = '/home/me';
|
||||
final Platform platform = FakePlatform(operatingSystem: 'linux', environment: <String, String>{'HOME': home});
|
||||
|
||||
fileSystem.directory(fileSystem.path.join('/snap/code/current/', '.vscode')).createSync(recursive: true);
|
||||
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[]);
|
||||
|
||||
final List<VsCode> installed = VsCode.allInstalled(fileSystem, platform, processManager);
|
||||
expect(installed.length, 1);
|
||||
});
|
||||
|
||||
testWithoutContext('can locate installations on macOS', () {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
const String home = '/home/me';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user