Skip to content

Fix file creation flow#37

Merged
ImSpeddy merged 3 commits intodevfrom
bugfix/newly-created-files-do-not-get-read
May 7, 2025
Merged

Fix file creation flow#37
ImSpeddy merged 3 commits intodevfrom
bugfix/newly-created-files-do-not-get-read

Conversation

@ImSpeddy
Copy link
Copy Markdown
Owner

@ImSpeddy ImSpeddy commented May 7, 2025

No description provided.

@ImSpeddy ImSpeddy requested a review from Copilot May 7, 2025 18:03
@ImSpeddy ImSpeddy self-assigned this May 7, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to fix the file creation flow by simplifying the file I/O operations to synchronous methods. Key changes include:

  • Removing the async declaration from openFile since synchronous file reads (fs.readFileSync) are used.
  • Logging file contents immediately after reading.
  • Updating the file creation button event handler and switching from fs.writeFile (asynchronous) to fs.writeFileSync (synchronous) for file writing.
Comments suppressed due to low confidence (1)

front/editor/editor.js:772

  • fs.writeFileSync is a synchronous API that does not accept a callback function. Remove the callback parameter or switch to fs.writeFile for asynchronous behavior.
fs.writeFileSync(`${args.dir}\${args.name}`, filedata, function (err) {

@ImSpeddy ImSpeddy merged commit c2be0b5 into dev May 7, 2025
1 check passed
@ImSpeddy ImSpeddy deleted the bugfix/newly-created-files-do-not-get-read branch May 7, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants