Skip to content

Commit

Permalink
🐛 Fix: Multi Build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashu11-A committed May 4, 2024
1 parent e53d6ff commit 4516173
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
16 changes: 13 additions & 3 deletions release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { exec as processChild } from 'child_process'
import { Presets, SingleBar } from 'cli-progress'
import { createHash } from 'crypto'
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'fs'
import { readFile, rm, stat, writeFile } from 'fs/promises'
import { readFile, rm, rmdir, stat, writeFile } from 'fs/promises'
import { glob } from 'glob'
import { obfuscate } from 'javascript-obfuscator'
import os from 'os'
Expand Down Expand Up @@ -208,8 +208,18 @@ class Build {

async installModules() {
console.debug('Baixando node_modules, sem as devDependencies\n\n')
await new Promise<void>((resolve, reject) => {
processChild(`cd ${this.options.outdir} && npm i && npm rebuild`, (error, stdout, stderr) => {
if (existsSync(`${this.options.outdir}/node_modules`)) {
await new Promise<void>(async (resolve, reject) => {
processChild(`cd ${this.options.outdir} && rm -r node_modules`, (error, stdout, stderr) => {
if (error !== null || stderr !== '') {
reject(error ?? stderr)
}
resolve()
})
})
}
await new Promise<void>(async (resolve, reject) => {
processChild(`cd ${this.options.outdir} && npm i && npm rebuild better_sqlite3 && npm rebuild`, (error, stdout, stderr) => {
if (error !== null || stderr !== '') {
reject(error ?? stderr)
}
Expand Down

0 comments on commit 4516173

Please sign in to comment.