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:
@@ -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);
|
||||
Reference in New Issue
Block a user