MCPcopy
hub / github.com/Binaryify/OneDark-Pro / updateCSS

Function updateCSS

src/utils/updateCSS.ts:7–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const getCSSPath = file => join(__dirname, '../../', 'styles', file)
6
7export function updateCSS() {
8 const configuration = workspace.getConfiguration('oneDarkPro')
9 const files = [
10 'atom-one-dark-inside.css',
11 'base-inside.css',
12 'markdown-inside.css'
13 ]
14 if (!configuration.get<boolean>('markdownStyle')) {
15 files.forEach(file => {
16 workspace.fs.writeFile(Uri.file(getCSSPath(file)), new TextEncoder().encode(''))
17 })
18 } else {
19 files.forEach(async file => {
20 const fileContents = await workspace.fs.readFile(Uri.file(getCSSPath(`./origin/${file}`)))
21 workspace.fs.writeFile(
22 Uri.file(getCSSPath(`./${file}`)),
23 fileContents)
24 })
25 }
26}

Callers 1

activateFunction · 0.90

Calls 1

getCSSPathFunction · 0.85

Tested by

no test coverage detected