mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 01:25:37 -05:00
Merge from vscode 2b0b9136329c181a9e381463a1f7dc3a2d105a34 (#4880)
This commit is contained in:
@@ -13,11 +13,10 @@ import pkg from 'vs/platform/product/node/package';
|
||||
import * as paths from 'vs/base/common/path';
|
||||
import * as os from 'os';
|
||||
import * as fs from 'fs';
|
||||
import { whenDeleted } from 'vs/base/node/pfs';
|
||||
import { whenDeleted, writeFileSync } from 'vs/base/node/pfs';
|
||||
import { findFreePort, randomPort } from 'vs/base/node/ports';
|
||||
import { resolveTerminalEncoding } from 'vs/base/node/encoding';
|
||||
import * as iconv from 'iconv-lite';
|
||||
import { writeFileAndFlushSync } from 'vs/base/node/extfs';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { ProfilingSession, Target } from 'v8-inspect-profiler';
|
||||
|
||||
@@ -98,9 +97,9 @@ export async function main(argv: string[]): Promise<any> {
|
||||
// prevent removing alternate data streams
|
||||
// (see https://github.com/Microsoft/vscode/issues/6363)
|
||||
fs.truncateSync(target, 0);
|
||||
writeFileAndFlushSync(target, data, { flag: 'r+' });
|
||||
writeFileSync(target, data, { flag: 'r+' });
|
||||
} else {
|
||||
writeFileAndFlushSync(target, data);
|
||||
writeFileSync(target, data);
|
||||
}
|
||||
|
||||
// Restore previous mode as needed
|
||||
|
||||
@@ -76,7 +76,7 @@ export class Main {
|
||||
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService
|
||||
) { }
|
||||
|
||||
async run(argv: ParsedArgs): Promise<any> {
|
||||
async run(argv: ParsedArgs): Promise<void> {
|
||||
if (argv['install-source']) {
|
||||
await this.setInstallSource(argv['install-source']);
|
||||
|
||||
@@ -95,11 +95,11 @@ export class Main {
|
||||
}
|
||||
}
|
||||
|
||||
private setInstallSource(installSource: string): Promise<any> {
|
||||
private setInstallSource(installSource: string): Promise<void> {
|
||||
return writeFile(this.environmentService.installSourcePath, installSource.slice(0, 30));
|
||||
}
|
||||
|
||||
private async listExtensions(showVersions: boolean): Promise<any> {
|
||||
private async listExtensions(showVersions: boolean): Promise<void> {
|
||||
const extensions = await this.extensionManagementService.getInstalled(ExtensionType.User);
|
||||
extensions.forEach(e => console.log(getId(e.manifest, showVersions)));
|
||||
}
|
||||
@@ -227,7 +227,7 @@ export class Main {
|
||||
}
|
||||
}
|
||||
|
||||
private async uninstallExtension(extensions: string[]): Promise<any> {
|
||||
private async uninstallExtension(extensions: string[]): Promise<void> {
|
||||
async function getExtensionId(extensionDescription: string): Promise<string> {
|
||||
if (!/\.vsix$/i.test(extensionDescription)) {
|
||||
return extensionDescription;
|
||||
|
||||
@@ -10,7 +10,6 @@ import * as extpath from 'vs/base/common/extpath';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import { sanitizeFilePath } from 'vs/base/node/extfs';
|
||||
|
||||
export function validatePaths(args: ParsedArgs): ParsedArgs {
|
||||
|
||||
@@ -45,7 +44,7 @@ function doValidatePaths(args: string[], gotoLineMode?: boolean): string[] {
|
||||
pathCandidate = preparePath(cwd, pathCandidate);
|
||||
}
|
||||
|
||||
const sanitizedFilePath = sanitizeFilePath(pathCandidate, cwd);
|
||||
const sanitizedFilePath = extpath.sanitizeFilePath(pathCandidate, cwd);
|
||||
|
||||
const basename = path.basename(sanitizedFilePath);
|
||||
if (basename /* can be empty if code is opened on root */ && !extpath.isValidBasename(basename)) {
|
||||
|
||||
@@ -29,9 +29,9 @@ function getUnixShellEnvironment(): Promise<typeof process.env> {
|
||||
|
||||
const buffers: Buffer[] = [];
|
||||
child.on('error', () => resolve({}));
|
||||
child.stdout.on('data', b => buffers.push(b as Buffer));
|
||||
child.stdout.on('data', b => buffers.push(b));
|
||||
|
||||
child.on('close', (code: number, signal: any) => {
|
||||
child.on('close', code => {
|
||||
if (code !== 0) {
|
||||
return reject(new Error('Failed to get environment'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user