Skip to content

Commit

Permalink
fix: check already patched before checking version
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Oct 12, 2023
1 parent 9aa655f commit ecbca82
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/monaco-treemending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ async function run () {
const monacoPackageJson = JSON.parse((await fs.readFile(monacoPackageJsonFile)).toString('utf-8'))
const monacoVersion = monacoPackageJson.version

if (typeof MONACO_VERSION !== 'undefined' && MONACO_VERSION !== monacoVersion) {
console.error(`Wrong monaco-editor version: expecting ${MONACO_VERSION}, got ${monacoVersion}`)
process.exit(1)
}

const alreadyPatched: boolean = monacoPackageJson.treemended ?? false
if (alreadyPatched) {
// eslint-disable-next-line no-console
console.info('Monaco-editor has already been tree-mended, ignoring')
process.exit(0)
}

if (typeof MONACO_VERSION !== 'undefined' && MONACO_VERSION !== monacoVersion) {
console.error(`Wrong monaco-editor version: expecting ${MONACO_VERSION}, got ${monacoVersion}`)
process.exit(1)
}

// pnpm WA: copy files to a temp directory and patch files there. When finished copy back
let workingDir = monacoEsmDirectory
let tmpDir: string
Expand Down

0 comments on commit ecbca82

Please sign in to comment.