Better compatibility between canvas and sharp in Windows (#829)

* fix: better compatibility between canvas and sharp in Windows

Signed-off-by: Tiago Costa <tdcosta100@gmail.com>

* fix: lint errors

Signed-off-by: Tiago Costa <tdcosta100@gmail.com>

---------

Signed-off-by: Tiago Costa <tdcosta100@gmail.com>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
tdcosta100
2023-08-02 11:19:25 -03:00
committed by GitHub
parent 37d4f449a9
commit 394dcf1f3e
4 changed files with 76 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
'use strict';
import * as process from 'process';
import * as child_process from 'child_process';
import * as url from 'url';
import * as path from 'path';
const originalPath = process.cwd();
process.chdir(
path.resolve(path.dirname(url.fileURLToPath(import.meta.url)), '..'),
);
if (
process.platform == 'win32' &&
(process.arch == 'ia32' || process.arch == 'x64')
) {
child_process.spawn('powershell.exe', [
'-ExecutionPolicy',
'Bypass',
'-File',
'install\\win32.ps1',
process.arch,
]);
}
process.chdir(originalPath);