resource deployment ext implementation -wip (#5508)

* resource types

* implement the dialog

* remove unused method

* fix issues

* formatting

* 5-17

* address comments and more tests
This commit is contained in:
Alan Ren
2019-05-17 20:24:02 -07:00
committed by GitHub
parent a59d1d3c05
commit 586fe10525
36 changed files with 2208 additions and 21 deletions

View File

@@ -0,0 +1,41 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as fs from 'fs';
import * as vscode from 'vscode';
/**
* Abstract of platform dependencies
*/
export interface IPlatformService {
platform(): string;
copyFile(source: string, target: string): void;
fileExists(file: string): boolean;
openFile(filePath: string): void;
showErrorMessage(message: string): void;
}
export class PlatformService implements IPlatformService {
platform(): string {
return process.platform;
}
copyFile(source: string, target: string): void {
fs.copyFileSync(source, target);
}
fileExists(file: string): boolean {
return fs.existsSync(file);
}
openFile(filePath: string): void {
vscode.commands.executeCommand('vscode.open', vscode.Uri.file(filePath));
}
showErrorMessage(message: string): void {
vscode.window.showErrorMessage(message);
}
}