From bd998a5ba92da1234bd6900c36638e6431c85e7b Mon Sep 17 00:00:00 2001 From: Jan Hannemann Date: Mon, 27 Apr 2020 12:24:35 -0700 Subject: [PATCH] only load module on windows --- src/utils/rc-edit.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/rc-edit.ts b/src/utils/rc-edit.ts index 7624f21..6318b77 100644 --- a/src/utils/rc-edit.ts +++ b/src/utils/rc-edit.ts @@ -1,10 +1,18 @@ -import { extractIcon } from 'exe-icon-extractor'; import * as fs from 'fs-extra'; import * as path from 'path'; import * as rcedit from 'rcedit'; import * as rcinfo from 'rcinfo'; import { getTempFilePath } from './fs-helper'; + +let extractIcon = (_: string, __: string): Buffer => { + throw Error('Not implemented'); +}; + +if (process.platform === 'win32') { + extractIcon = require('exe-icon-extractor').extractIcon; +} + interface RcInfo { 'version-string': { CompanyName?: string;