mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 01:25:37 -05:00
This reverts commit 5d44b6a6a7.
This commit is contained in:
@@ -112,10 +112,6 @@ export class Main {
|
||||
private async installExtensions(extensions: string[], force: boolean): Promise<void> {
|
||||
const failed: string[] = [];
|
||||
const installedExtensionsManifests: IExtensionManifest[] = [];
|
||||
if (extensions.length) {
|
||||
console.log(localize('installingExtensions', "Installing extensions..."));
|
||||
}
|
||||
|
||||
for (const extension of extensions) {
|
||||
try {
|
||||
const manifest = await this.installExtension(extension, force);
|
||||
@@ -146,11 +142,11 @@ export class Main {
|
||||
|
||||
if (valid) {
|
||||
return this.extensionManagementService.install(URI.file(extension)).then(id => {
|
||||
console.log(localize('successVsixInstall', "Extension '{0}' was successfully installed.", getBaseLabel(extension)));
|
||||
console.log(localize('successVsixInstall', "Extension '{0}' was successfully installed!", getBaseLabel(extension)));
|
||||
return manifest;
|
||||
}, error => {
|
||||
if (isPromiseCanceledError(error)) {
|
||||
console.log(localize('cancelVsixInstall', "Cancelled installing extension '{0}'.", getBaseLabel(extension)));
|
||||
console.log(localize('cancelVsixInstall', "Cancelled installing Extension '{0}'.", getBaseLabel(extension)));
|
||||
return null;
|
||||
} else {
|
||||
return Promise.reject(error);
|
||||
@@ -195,7 +191,9 @@ export class Main {
|
||||
console.log(localize('forceUpdate', "Extension '{0}' v{1} is already installed, but a newer version {2} is available in the marketplace. Use '--force' option to update to newer version.", id, installedExtension.manifest.version, extension.version));
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
console.log(localize('updateMessage', "Updating the extension '{0}' to the version {1}", id, extension.version));
|
||||
console.log(localize('updateMessage', "Updating the Extension '{0}' to the version {1}", id, extension.version));
|
||||
} else {
|
||||
console.log(localize('foundExtension', "Found '{0}' in the marketplace.", id));
|
||||
}
|
||||
await this.installFromGallery(id, extension);
|
||||
return manifest;
|
||||
@@ -212,7 +210,7 @@ export class Main {
|
||||
const newer = installedExtensions.filter(local => areSameExtensions(extensionIdentifier, local.identifier) && semver.gt(local.manifest.version, manifest.version))[0];
|
||||
|
||||
if (newer && !force) {
|
||||
console.log(localize('forceDowngrade', "A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.", newer.identifier.id, newer.manifest.version, manifest.version));
|
||||
console.log(localize('forceDowngrade', "A newer version of this extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.", newer.identifier.id, newer.manifest.version, manifest.version));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -220,14 +218,14 @@ export class Main {
|
||||
}
|
||||
|
||||
private async installFromGallery(id: string, extension: IGalleryExtension): Promise<void> {
|
||||
console.log(localize('installing', "Installing extension '{0}' v{1}...", id, extension.version));
|
||||
console.log(localize('installing', "Installing..."));
|
||||
|
||||
try {
|
||||
await this.extensionManagementService.installFromGallery(extension);
|
||||
console.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed.", id, extension.version));
|
||||
console.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed!", id, extension.version));
|
||||
} catch (error) {
|
||||
if (isPromiseCanceledError(error)) {
|
||||
console.log(localize('cancelVsixInstall', "Cancelled installing extension '{0}'.", id));
|
||||
console.log(localize('cancelVsixInstall', "Cancelled installing Extension '{0}'.", id));
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -7,16 +7,11 @@ import * as cp from 'child_process';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
function getUnixShellEnvironment(logService: ILogService): Promise<typeof process.env> {
|
||||
function getUnixShellEnvironment(): Promise<typeof process.env> {
|
||||
const promise = new Promise<typeof process.env>((resolve, reject) => {
|
||||
const runAsNode = process.env['ELECTRON_RUN_AS_NODE'];
|
||||
logService.trace('getUnixShellEnvironment#runAsNode', runAsNode);
|
||||
|
||||
const noAttach = process.env['ELECTRON_NO_ATTACH_CONSOLE'];
|
||||
logService.trace('getUnixShellEnvironment#noAttach', noAttach);
|
||||
|
||||
const mark = generateUuid().replace(/-/g, '').substr(0, 12);
|
||||
const regex = new RegExp(mark + '(.*)' + mark);
|
||||
|
||||
@@ -26,9 +21,6 @@ function getUnixShellEnvironment(logService: ILogService): Promise<typeof proces
|
||||
});
|
||||
|
||||
const command = `'${process.execPath}' -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
|
||||
logService.trace('getUnixShellEnvironment#env', env);
|
||||
logService.trace('getUnixShellEnvironment#spawn', command);
|
||||
|
||||
const child = cp.spawn(process.env.SHELL!, ['-ilc', command], {
|
||||
detached: true,
|
||||
stdio: ['ignore', 'pipe', process.stderr],
|
||||
@@ -45,8 +37,6 @@ function getUnixShellEnvironment(logService: ILogService): Promise<typeof proces
|
||||
}
|
||||
|
||||
const raw = Buffer.concat(buffers).toString('utf8');
|
||||
logService.trace('getUnixShellEnvironment#raw', raw);
|
||||
|
||||
const match = regex.exec(raw);
|
||||
const rawStripped = match ? match[1] : '{}';
|
||||
|
||||
@@ -68,10 +58,8 @@ function getUnixShellEnvironment(logService: ILogService): Promise<typeof proces
|
||||
// https://github.com/Microsoft/vscode/issues/22593#issuecomment-336050758
|
||||
delete env['XDG_RUNTIME_DIR'];
|
||||
|
||||
logService.trace('getUnixShellEnvironment#result', env);
|
||||
resolve(env);
|
||||
} catch (err) {
|
||||
logService.error('getUnixShellEnvironment#error', err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
@@ -89,17 +77,14 @@ let _shellEnv: Promise<typeof process.env>;
|
||||
* This should only be done when Code itself is not launched
|
||||
* from within a shell.
|
||||
*/
|
||||
export function getShellEnvironment(logService: ILogService): Promise<typeof process.env> {
|
||||
export function getShellEnvironment(): Promise<typeof process.env> {
|
||||
if (_shellEnv === undefined) {
|
||||
if (isWindows) {
|
||||
logService.trace('getShellEnvironment: runing on windows, skipping');
|
||||
_shellEnv = Promise.resolve({});
|
||||
} else if (process.env['VSCODE_CLI'] === '1') {
|
||||
logService.trace('getShellEnvironment: runing on CLI, skipping');
|
||||
_shellEnv = Promise.resolve({});
|
||||
} else {
|
||||
logService.trace('getShellEnvironment: running on Unix');
|
||||
_shellEnv = getUnixShellEnvironment(logService);
|
||||
_shellEnv = getUnixShellEnvironment();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user