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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore ability to commit when using Atom with Electron 2.0 #1457

Merged
merged 2 commits into from May 11, 2018

Conversation

Projects
None yet
2 participants
@jasonrudolph
Member

jasonrudolph commented May 10, 2018

Motivation

With the current version of the GitHub package, it's not possible to create a commit on macOS when using an Electron 2.0 build of Atom:

  1. Install Atom built with Electron 2.0 and github package 0.14.0-3 [atom-mac.zip]
  2. Open any git repository in Atom
  3. Change a file and save it
  4. Open the git tab and stage the changes
  5. Click the "commit" button
  6. Observe that the change was not committed
  7. Open the console and observe the following error:

    Uncaught (in promise) Error: ENOTDIR: not a directory, copyfile '/Applications/Atom.app/Contents/Resources/app.asar/node_modules/github/bin/git-askpass-atom.sh' -> '/tmp/github-11848-53871-116kyba.1tjh/git-askpass-atom.sh'

Suspected cause

In atom/atom#17273 (comment), @smashwilson noted:

here's the failing fs.copy call:

await fs.copy(
path.resolve(getPackageRoot(), 'bin', filename),
path.join(this.root, filename),
);

We're using the fs-extra module for extra filesystem operations (and promisification).

And in chat, @smashwilson commented:

I suspect the problem is a regression in Electron's asar integration - the fs-extra (or fs) module is no longer able to see directories within ~/src/atom/atom/out/Atom.app/Contents/Resources/app.asar/.

It looks like other projects are seeing similar issues with fs-extra 5.0 and newer:

We almost completely rewrote copySync in v5, so it doesn't surprise me that there's a few bugs here and there. -- jprichardson/node-fs-extra#546

Proposed remedy

Since the GitHub package only recently upgraded from fs-extra 2.1.2 to 6.0.0 two months ago in #1350 and #1427, it seems like the most expedient remedy is to drop back down to a pre-5.0 version for the time being. This pull request uses fs-extra 4.0.3, which is the highest version in the 4.x series.

This change restores the ability to commit with the GitHub package on Electron 2.0, and it unblocks atom/atom#17273. 馃槄

jasonrudolph added some commits May 10, 2018

@jasonrudolph jasonrudolph requested a review from smashwilson May 10, 2018

@smashwilson

馃憤 Sure.

@smashwilson smashwilson merged commit 3c99511 into master May 11, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@smashwilson smashwilson deleted the downgrade-fs-extra branch May 11, 2018

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