microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.1.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/extension/reactDirManager.ts

25lines · modeblame

b3a793eeNisheet Jain10 years ago1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
9c9df666Meena Kunnathur Balakrishnan10 years ago4import {FileSystem} from "../common/node/fileSystem";
b3a793eeNisheet Jain10 years ago5import * 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 {
13public static ReactDirPath = path.join(vscode.workspace.rootPath, ".vscode", ".react");
14
15constructor() {
16let fs = new FileSystem();
17/* if the folder exists, remove it, then recreate it */
18fs.removePathRecursivelyAsync(ReactDirManager.ReactDirPath)
19.done(() => fs.mkDir(ReactDirManager.ReactDirPath));
20}
21
22public dispose(): void {
23new FileSystem().removePathRecursivelySync(ReactDirManager.ReactDirPath);
24}
25}