Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Cannot launch app from the command line? #41

Closed
al-the-x opened this issue Mar 17, 2016 · 10 comments
Closed

Cannot launch app from the command line? #41

al-the-x opened this issue Mar 17, 2016 · 10 comments

Comments

@al-the-x
Copy link

Not sure what's happening yet, but I've tried launching the application from the command line as I would for any other app -- open <filename> -a Abricotine -- and the application launches but does not spawn any windows. When I launch the app with Finder, it seems to do fine.

@al-the-x
Copy link
Author

I also notice that I can't kill the app via Cmd-Q if there are no windows open, but that seems documented in #38 and #32.

@brrd
Copy link
Owner

brrd commented Mar 17, 2016

Probably related to another OSX-specific behavior such as: https://github.com/atom/electron/blob/master/docs/api/app.md#event-open-file-os-x

Right now you can try with $ path/to/Abricotine path/to/file.md which is the standard way to open a file regardless of the OS.

@nloveladyallen
Copy link
Contributor

Note: on OS X the executable will be in /Applications/Abricotine.app/Contents/MacOS/Electron (assuming you put the app bundle in in /Applications).

@brrd
Copy link
Owner

brrd commented Apr 4, 2016

I think that b1e20d7 fixed this issue.
Feedback from OSX users would be appreciated. You can build the app from develop branch or wait for version 0.3.1 to be released.

@nloveladyallen
Copy link
Contributor

OS X launches the application, but Abricotine does not open the document. It gives the following error:

A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: argv.filter is not a function
at Object.AbrApplication.run (/Users/noah/Applications/Abricotine/Abricotine.app/Contents/Resources/app.asar/app/abr-application.js:96:29)
at /Users/noah/Applications/Abricotine/Abricotine.app/Contents/Resources/app.asar/app/theme-loader.js:36:29
at /Users/noah/Applications/Abricotine/Abricotine.app/Contents/Resources/app.asar/app/files.js:162:17
at /Users/noah/Applications/Abricotine/Abricotine.app/Contents/Resources/app.asar/node_modules/graceful-fs/graceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:82:15)

The application is basically an empty shell. No menus are visible except the Application menu, keyboard shortcuts do not work, no window opens.

This isn't just the command line either: right-click markdown file in Finder>Open With>Other...>Abricotine also gives the same error.

If Abricotine is already open, nothing happens.

@brrd
Copy link
Owner

brrd commented Apr 5, 2016

@nloveladyallen thanks for reporting.

I created a dedicated branch where this issue should be fixed now. Could someone try it and tell me if it works?

Can you try:

  • to open a file while Abricotine is not running yet,
  • same as above but with 2 files,
  • to open a file when Abricotine is already running (this one is maybe not working).

By saying "open a file", I mean either to use the open <filename> -a Abricotine command or Finder>Open With menu. They behave the same on OSX. (I think dropping the file on the app icon in the dock should be the same too)

Thanks

@nloveladyallen
Copy link
Contributor

to open a file while Abricotine is not running yet,

This works.

same as above but with 2 files,

Only the second file opens.

to open a file when Abricotine is already running (this one is maybe not working).

This does not work either. The application comes into focus but the file is not opened.

@brrd
Copy link
Owner

brrd commented Apr 5, 2016

I updated the osx-open-file branch, I bet this would do the job. Could you try it once again?
If this last version is still not good, then I would leave this issue to some other contributors who could directly run tests on OSX.

@nloveladyallen
Copy link
Contributor

It works now. One file, two files, and already-open all work as expected, from Finder or command line.

@brrd
Copy link
Owner

brrd commented Apr 6, 2016

Very good news! It will be in v. 0.3.1.
@nloveladyallen thanks!

@brrd brrd closed this as completed in b1e20d7 Apr 6, 2016
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants