Skip to content

Commit

Permalink
fix(cli-utils): output file creates new content
Browse files Browse the repository at this point in the history
  • Loading branch information
andresin87 authored and soykje committed Jun 27, 2024
1 parent a7e8129 commit 973ffa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/utils/cli/src/scan/index.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as process from 'node:process'

import { appendFileSync, existsSync, mkdirSync } from 'fs'
import { existsSync, mkdirSync, writeFileSync } from 'fs'
import merge from 'lodash.merge'
import path from 'path'

Expand Down Expand Up @@ -114,7 +114,7 @@ export async function adoption(options) {
if (!existsSync(dir)) {
mkdirSync(dir, { recursive: true })
}
appendFileSync(`${path.join(process.cwd(), output)}`, JSON.stringify(result, null, 2))
writeFileSync(`${path.join(process.cwd(), output)}`, JSON.stringify(result, null, 2))
} catch (err) {
logger.error(`💥 Error writing file: ${err}`)
process.exit(1)
Expand Down

0 comments on commit 973ffa8

Please sign in to comment.