mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -17,6 +17,9 @@ import * as git from './git';
|
||||
import * as VinylFile from 'vinyl';
|
||||
import { ThroughStream } from 'through';
|
||||
import * as sm from 'source-map';
|
||||
import { IDownloadOptions, downloadInExternalProcess, IDownloadRequestOptions } from '../download/download';
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
export interface ICancellationToken {
|
||||
isCancellationRequested(): boolean;
|
||||
@@ -233,8 +236,8 @@ export function rimraf(dir: string): (cb: any) => void {
|
||||
return cb(err);
|
||||
});
|
||||
};
|
||||
|
||||
return cb => retry(cb);
|
||||
retry.taskName = `clean-${path.basename(dir)}`;
|
||||
return retry;
|
||||
}
|
||||
|
||||
export function getVersion(root: string): string | undefined {
|
||||
@@ -280,3 +283,38 @@ export function versionStringToNumber(versionStr: string) {
|
||||
|
||||
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||
}
|
||||
|
||||
export function download(requestOptions: IDownloadRequestOptions): NodeJS.ReadWriteStream {
|
||||
const result = es.through();
|
||||
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||
const opts: IDownloadOptions = {
|
||||
requestOptions: requestOptions,
|
||||
destinationPath: filename
|
||||
};
|
||||
downloadInExternalProcess(opts).then(() => {
|
||||
fs.stat(filename, (err, stat) => {
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
return;
|
||||
}
|
||||
fs.readFile(filename, (err, data) => {
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
return;
|
||||
}
|
||||
fs.unlink(filename, () => {
|
||||
result.emit('data', new VinylFile({
|
||||
path: path.normalize(requestOptions.path),
|
||||
stat: stat,
|
||||
base: path.normalize(requestOptions.path),
|
||||
contents: data
|
||||
}));
|
||||
result.emit('end');
|
||||
});
|
||||
});
|
||||
});
|
||||
}, (err) => {
|
||||
result.emit('error', err);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user