MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / removeDirectory

Function removeDirectory

src/session.ts:113–127  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

111}
112
113export function removeDirectory(dir: string): void {
114 console.info(`[removeDirectory] dir: ${dir}`);
115 if (fs.existsSync(dir)) {
116 console.info('[removeDirectory] dir exists');
117 fs.readdirSync(dir)
118 .forEach((file) => {
119 const curPath = path.join(dir, file);
120 console.info(`[removeDirectory] Remove ${curPath}`);
121 fs.unlinkSync(curPath);
122 });
123 console.info(`[removeDirectory] Remove dir ${dir}`);
124 fs.rmdirSync(dir);
125 }
126 console.info('[removeDirectory] Done');
127}
128
129export function sessionDirectoryExists(): boolean {
130 return (fs.existsSync(sessionDir));

Callers 1

removeSessionFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected