microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/extension/appcenter/appCenterUtils.ts
22lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | // tslint:disable-next-line:no-var-requires |
| 5 | const opener = require("opener"); |
| 6 | // tslint:disable-next-line:no-var-requires |
| 7 | const open = require("open"); |
| 8 | |
| 9 | export class ACUtils { |
| 10 | // Use open for Windows and Mac, opener for Linux |
| 11 | public static OpenUrl(url: string): void { |
| 12 | switch (process.platform) { |
| 13 | case "win32": |
| 14 | case "darwin": |
| 15 | open(url); |
| 16 | break; |
| 17 | default: |
| 18 | opener(url); |
| 19 | break; |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | |