From ef6fc5fc2d18aab4ec19f10c5b936dc4adebebd7 Mon Sep 17 00:00:00 2001 From: Jerome Thayananthajothy Date: Thu, 5 Sep 2024 04:12:00 +0100 Subject: [PATCH] Fix postinstall script issues --- scripts/postinstall.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 4e44eab..f7226f6 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -1,11 +1,11 @@ -import { exec } from 'child_process'; -import os from 'os'; -import { promises as fs } from 'fs'; -import path from 'path'; -import unzipper from 'unzipper'; -import archiver from 'archiver'; +/* eslint-disable @typescript-eslint/no-var-requires */ +const { exec } = require('child_process'); +const os = require('os'); +const fs = require('fs').promises; +const path = require('path'); +const unzipper = require('unzipper'); +const archiver = require('archiver'); -const __dirname = path.dirname(new URL(import.meta.url).pathname); const appxFilePath = path.resolve(__dirname, '../out/make/JeromeThayananthajothy.CometApp.appx'); const outputAppxPath = path.resolve(__dirname, '../out/make/JeromeThayananthajothy.CometApp-modified.appx'); const tempDir = path.resolve(__dirname, '../temp/appx'); @@ -47,11 +47,11 @@ async function modifyManifest() { const output = fs.createWriteStream(outputAppxPath); const archive = archiver('zip', { zlib: { level: 9 } }); - output.on('close', () => { + output.on('close', function () { console.log(`${archive.pointer()} total bytes written`); }); - archive.on('error', (err) => { + archive.on('error', function (err) { throw err; });