Skip to content

Commit

Permalink
Extract appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
rianadon committed Jan 1, 2024
1 parent 1edd11e commit adb2c13
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/model_gen/download-openscad.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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 => {
Expand Down

0 comments on commit adb2c13

Please sign in to comment.