Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built vue-electron apps' files are not closed #437

Closed
Bbansjkl opened this issue Dec 18, 2018 · 5 comments
Closed

Built vue-electron apps' files are not closed #437

Bbansjkl opened this issue Dec 18, 2018 · 5 comments
Assignees

Comments

@Bbansjkl
Copy link

  • VSCode Version: 1.30.0
  • OS Version: Windows 7 Professional, Version 6.1 (Build 7601: Service Pack 1)
  • Extension Version: 1.46.4
  • System Language: German
  • SVN Version: 1.10.2.924

Issue

When building a vue-electron application (potentially any electron app), the build can't be repeated since the files \dist_electron\win-unpacked\app.asar and \dist_electron\win-unpacked\electron.asar seem to still be opened by this extension. At least disabling the svn extension results in the files not being locked after it's built, and it can freely be deleted and a new build be created.
To verify this, I've also disabled all other extension - with SVN being the only active extension, the files cannot be deleted since they're "still opened in another folder or application".
My current repo is not part of an SVN repository. It doesn't matter if the build processed is started by using the integrated console or an external one. Simply copying the files into the project folder does not trigger the lock though.

Steps to Reproduce

  1. Build an electron app while VSC with this extension active (e.g. from this repo: https://github.com/Bbansjkl/electron-build-env-test - run npm install and npm run electron:build
  2. Try to delete it

SVN Output

Using svn "1.10.2" from "C:\Program Files\TortoiseSVN\bin\svn.exe"
@edgardmessias
Copy link
Contributor

The bug is caused by usage of fs.stat or fs.statSync with asar file. The file descriptor is never closed.

For asar files, the isDirectory() returns true and isFile() return false

@JohnstonCode
Copy link
Owner

JohnstonCode commented Mar 28, 2019

I thought fs.stat and fs.statSync return instances of fs.Stats and not a fd

@edgardmessias
Copy link
Contributor

I am working to solve this, replace "fs" with "original-fs".
Read: https://electronjs.org/docs/tutorial/application-packaging#treating-an-asar-archive-as-a-normal-file

@edgardmessias
Copy link
Contributor

Note: dont use process.noAsar = true, becase "VSCode" use asar

@edgardmessias edgardmessias self-assigned this Mar 28, 2019
edgardmessias added a commit to edgardmessias/svn-scm that referenced this issue Mar 28, 2019
JohnstonCode added a commit that referenced this issue Mar 28, 2019
## [1.47.11](v1.47.10...v1.47.11) (2019-03-28)

### Bug Fixes

* Fixed .asar file locking (close [#437](#437)) ([#539](#539)) ([66af99b](66af99b))
@JohnstonCode
Copy link
Owner

🎉 This issue has been resolved in version 1.47.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants