forked from qingtingzhiyu/spext-xt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfsUtils.mjs
More file actions
31 lines (26 loc) · 940 Bytes
/
fsUtils.mjs
File metadata and controls
31 lines (26 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* --------------------------------------------------------------------------------------------
* SonarLint for VisualStudio Code
* Copyright (C) 2017-2022 SonarSource SA
* sonarlint@sonarsource.com
* Licensed under the LGPLv3 License. See LICENSE.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import del from 'del';
import { info } from 'fancy-log';
import { pathExistsSync, removeSync } from 'fs-extra/esm';
import { readFileSync, unlinkSync } from 'fs';
export function clean() {
info('Starting task "clean"');
del(['*.vsix', 'server', 'out', 'out-cov']);
}
export function cleanJreDir() {
if (pathExistsSync('./jre')) {
removeSync('./jre');
}
}
export function getPackageJSON() {
return JSON.parse(readFileSync('package.json').toString());
}
export function deleteFile(filePath) {
unlinkSync(filePath);
}