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 { TerminalColorSchemeProvider, TerminalColorScheme } from 'terminus-terminal'
const schemeContents = require.context('../schemes/', true, /.*/)
const schemeContents = require.context('../schemes/', false, /.*/)
@Injectable()
export class ColorSchemes extends TerminalColorSchemeProvider {
async getSchemes (): Promise<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')
// process #define variables