mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 17:23:15 -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:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import product from 'vs/platform/node/product';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
|
||||
import { IRequestService } from 'vs/platform/request/node/request';
|
||||
@@ -15,9 +15,6 @@ import { createUpdateURL, AbstractUpdateService } from 'vs/platform/update/elect
|
||||
import { asJson } from 'vs/base/node/request';
|
||||
import { shell } from 'electron';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import * as path from 'path';
|
||||
import { spawn } from 'child_process';
|
||||
import { realpath } from 'fs';
|
||||
|
||||
export class LinuxUpdateService extends AbstractUpdateService {
|
||||
|
||||
@@ -45,61 +42,36 @@ export class LinuxUpdateService extends AbstractUpdateService {
|
||||
|
||||
this.setState(State.CheckingForUpdates(context));
|
||||
|
||||
if (process.env.SNAP && process.env.SNAP_REVISION) {
|
||||
this.checkForSnapUpdate();
|
||||
} else {
|
||||
this.requestService.request({ url: this.url }, CancellationToken.None)
|
||||
.then<IUpdate>(asJson)
|
||||
.then(update => {
|
||||
if (!update || !update.url || !update.version || !update.productVersion) {
|
||||
/* __GDPR__
|
||||
"update:notAvailable" : {
|
||||
"explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('update:notAvailable', { explicit: !!context });
|
||||
|
||||
this.setState(State.Idle(UpdateType.Archive));
|
||||
} else {
|
||||
this.setState(State.AvailableForDownload(update));
|
||||
}
|
||||
})
|
||||
.then(undefined, err => {
|
||||
this.logService.error(err);
|
||||
|
||||
this.requestService.request({ url: this.url }, CancellationToken.None)
|
||||
.then<IUpdate>(asJson)
|
||||
.then(update => {
|
||||
if (!update || !update.url || !update.version || !update.productVersion) {
|
||||
/* __GDPR__
|
||||
"update:notAvailable" : {
|
||||
"explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
|
||||
}
|
||||
"update:notAvailable" : {
|
||||
"explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('update:notAvailable', { explicit: !!context });
|
||||
|
||||
// only show message when explicitly checking for updates
|
||||
const message: string | undefined = !!context ? (err.message || err) : undefined;
|
||||
this.setState(State.Idle(UpdateType.Archive, message));
|
||||
});
|
||||
}
|
||||
}
|
||||
this.setState(State.Idle(UpdateType.Archive));
|
||||
} else {
|
||||
this.setState(State.AvailableForDownload(update));
|
||||
}
|
||||
})
|
||||
.then(undefined, err => {
|
||||
this.logService.error(err);
|
||||
|
||||
private checkForSnapUpdate(): void {
|
||||
// If the application was installed as a snap, updates happen in the
|
||||
// background automatically, we just need to check to see if an update
|
||||
// has already happened.
|
||||
realpath(`${path.dirname(process.env.SNAP!)}/current`, (err, resolvedCurrentSnapPath) => {
|
||||
if (err) {
|
||||
this.logService.error('update#checkForSnapUpdate(): Could not get realpath of application.');
|
||||
return;
|
||||
}
|
||||
/* __GDPR__
|
||||
"update:notAvailable" : {
|
||||
"explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('update:notAvailable', { explicit: !!context });
|
||||
|
||||
const currentRevision = path.basename(resolvedCurrentSnapPath);
|
||||
|
||||
if (process.env.SNAP_REVISION !== currentRevision) {
|
||||
// TODO@joao: snap
|
||||
this.setState(State.Ready({ version: '', productVersion: '' }));
|
||||
} else {
|
||||
this.setState(State.Idle(UpdateType.Archive));
|
||||
}
|
||||
});
|
||||
// only show message when explicitly checking for updates
|
||||
const message: string | undefined = !!context ? (err.message || err) : undefined;
|
||||
this.setState(State.Idle(UpdateType.Archive, message));
|
||||
});
|
||||
}
|
||||
|
||||
protected async doDownloadUpdate(state: AvailableForDownload): Promise<void> {
|
||||
@@ -113,23 +85,4 @@ export class LinuxUpdateService extends AbstractUpdateService {
|
||||
|
||||
this.setState(State.Idle(UpdateType.Archive));
|
||||
}
|
||||
|
||||
protected doQuitAndInstall(): void {
|
||||
this.logService.trace('update#quitAndInstall(): running raw#quitAndInstall()');
|
||||
|
||||
const snap = process.env.SNAP;
|
||||
|
||||
// TODO@joao what to do?
|
||||
if (!snap) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Allow 3 seconds for VS Code to close
|
||||
spawn('sleep 3 && $SNAP_NAME', {
|
||||
shell: true,
|
||||
detached: true,
|
||||
stdio: 'ignore',
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user