fixed #3333 - duplicate color schemes

This commit is contained in:
Eugene Pankov 2021-01-14 09:48:58 +01:00
parent 2f3e32990a
commit fe936c7726
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -1,14 +1,14 @@
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { TerminalColorSchemeProvider, TerminalColorScheme } from 'terminus-terminal' import { TerminalColorSchemeProvider, TerminalColorScheme } from 'terminus-terminal'
const schemeContents = require.context('../schemes/', true, /.*/) const schemeContents = require.context('../schemes/', false, /.*/)
@Injectable() @Injectable()
export class ColorSchemes extends TerminalColorSchemeProvider { export class ColorSchemes extends TerminalColorSchemeProvider {
async getSchemes (): Promise<TerminalColorScheme[]> { async getSchemes (): Promise<TerminalColorScheme[]> {
const schemes: TerminalColorScheme[] = [] const schemes: TerminalColorScheme[] = []
schemeContents.keys().forEach(schemeFile => { schemeContents.keys().filter(x => !x.startsWith('./')).forEach(schemeFile => {
const lines = (schemeContents(schemeFile).default as string).split('\n') const lines = (schemeContents(schemeFile).default as string).split('\n')
// process #define variables // process #define variables