From adb2c137ab661367fc3b10b5dc2acdf8d11cf821 Mon Sep 17 00:00:00 2001 From: Ryan Adolf Date: Sun, 31 Dec 2023 21:21:03 -0800 Subject: [PATCH] Extract appimage --- src/model_gen/download-openscad.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/model_gen/download-openscad.ts b/src/model_gen/download-openscad.ts index 5b11e70..e229fb6 100644 --- a/src/model_gen/download-openscad.ts +++ b/src/model_gen/download-openscad.ts @@ -1,5 +1,5 @@ -import { spawnSync } from 'child_process' -import { accessSync, constants, createWriteStream, existsSync, linkSync, lstatSync } from 'fs' +import { execFileSync, spawnSync } from 'child_process' +import { accessSync, constants, createWriteStream, existsSync, linkSync, lstatSync, readdirSync } from 'fs' import { join } from 'path' import * as readline from 'readline/promises' import { Readable } from 'stream' @@ -125,6 +125,13 @@ async function main() { const res = await fetch(url) const fileStream = createWriteStream(destination, { flags: 'wx', mode: 0o777 }) await finished(Readable.fromWeb(res.body).pipe(fileStream)) + + if (process.platform == 'linux' && process.env['CI']) { + // Some CI systems (like Vercel) don't have FUSE, so extract the appimage. + console.log('Extracting AppImage...') + execFileSync(destination, ['--appimage-extract']) + console.log(readdirSync(targetDir)) + } } main().catch(e => {