microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
147d9cc549da9c4c4297f65e799484b78fe8de80

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/reactDirManager.ts

25lines · 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
4import {FileSystem} from "../common/node/fileSystem";
5import * as vscode from "vscode";
6import * as path from "path";
7
8/**
9 * Manages the lifecycle of the .vscode/.react folder, which hosts the temporary source/map files we need for debugging.
10 * We use synchronous operations here because we want to return after the init/cleanup has been done.
11 */
12export class ReactDirManager implements vscode.Disposable {
13 public static ReactDirPath = path.join(vscode.workspace.rootPath, ".vscode", ".react");
14
15 constructor() {
16 let fs = new FileSystem();
17 /* if the folder exists, remove it, then recreate it */
18 fs.removePathRecursivelyAsync(ReactDirManager.ReactDirPath)
19 .done(() => fs.mkDir(ReactDirManager.ReactDirPath));
20 }
21
22 public dispose(): void {
23 new FileSystem().removePathRecursivelySync(ReactDirManager.ReactDirPath);
24 }
25}