|
1 | 1 | import { ConfigurationChangeEvent, Disposable, GlobalEnvironmentVariableCollection } from 'vscode'; |
2 | 2 | import { getWorkspaceFolder, getWorkspaceFolders, onDidChangeConfiguration } from '../../../common/workspace.apis'; |
3 | 3 | import { getAutoActivationType, setAutoActivationType } from '../utils'; |
4 | | -import { ShellStartupProvider } from './startupProvider'; |
| 4 | +import { ShellScriptEditState, ShellSetupState, ShellStartupProvider } from './startupProvider'; |
5 | 5 | import { DidChangeEnvironmentEventArgs } from '../../../api'; |
6 | 6 | import { EnvironmentManagers } from '../../../internal.api'; |
7 | 7 | import { traceError, traceInfo } from '../../../common/logging'; |
@@ -87,7 +87,9 @@ export class ShellStartupActivationManagerImpl implements ShellStartupActivation |
87 | 87 |
|
88 | 88 | private async isSetupRequired(): Promise<boolean> { |
89 | 89 | const results = await Promise.all(this.shellStartupProviders.map((provider) => provider.isSetup())); |
90 | | - return results.some((result) => !result); |
| 90 | + return results |
| 91 | + .filter((r) => r !== ShellSetupState.NotInstalled) |
| 92 | + .some((result) => result === ShellSetupState.NotSetup); |
91 | 93 | } |
92 | 94 |
|
93 | 95 | public async initialize(): Promise<void> { |
@@ -145,17 +147,11 @@ export class ShellStartupActivationManagerImpl implements ShellStartupActivation |
145 | 147 | } |
146 | 148 |
|
147 | 149 | public async updateStartupScripts(): Promise<void> { |
148 | | - const results = await Promise.all( |
149 | | - this.shellStartupProviders.map(async (provider) => { |
150 | | - const result = await provider.setupScripts(); |
151 | | - if (!result) { |
152 | | - traceError(`Failed to setup shell startup scripts for ${provider.name}`); |
153 | | - } |
154 | | - return result; |
155 | | - }), |
156 | | - ); |
| 150 | + const results = await Promise.all(this.shellStartupProviders.map(async (provider) => provider.setupScripts())); |
157 | 151 |
|
158 | | - const success = results.every((result) => result); |
| 152 | + const success = results |
| 153 | + .filter((r) => r !== ShellScriptEditState.NotInstalled) |
| 154 | + .every((result) => result === ShellScriptEditState.Edited); |
159 | 155 |
|
160 | 156 | // Intentionally not awaiting this message. We don’t need a response here, and awaiting here for user response can |
161 | 157 | // block setting up rest of the startup activation. |
|
0 commit comments