tileserver-gl/install/canvas_sharp_compatibility.js
tdcosta100 394dcf1f3e
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>
2023-08-02 10:19:25 -04:00

27 lines
555 B
JavaScript

'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);