From 7709ee957da14f754450d44c129badf46c8e92b2 Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Tue, 1 Sep 2020 20:59:34 +0100 Subject: [PATCH] removed script used to create hard coded fan tables --- build-src/fan_table_format.ts | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 build-src/fan_table_format.ts diff --git a/build-src/fan_table_format.ts b/build-src/fan_table_format.ts deleted file mode 100644 index e20ab0b4..00000000 --- a/build-src/fan_table_format.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as process from 'process'; -import * as readline from 'readline'; -import { SIGINT, SIGTERM } from 'constants'; - -const dataList: string[] = []; - -process.stdin.on('data', (dataChunk: Buffer) => { - dataList.push(dataChunk.toString()); -}); - -process.on('SIGINT', () => { - const data = dataList.join(''); - const lines: string[] = data.split('\n'); - let pairs = lines.map(line => line.split(RegExp('[ \t]+'))); - pairs = pairs.filter(pair => pair.length === 2); - const stringEntries = pairs.map(pair => ({ temp: pair[0].trim(), speed: pair[1].trim() })); - for (const entry of stringEntries) { - if (entry.speed === '') { entry.speed = '0'; } - process.stdout.write('{ temp: ' + entry.temp + ', speed: ' + entry.speed + ' },\n'); - } - process.exit(SIGINT); -});