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

Add an 'open' utility to Phoenix #344

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AtkinsSJ
Copy link
Contributor

No description provided.

@HeyPuter HeyPuter deleted a comment from Marcos323232 Apr 25, 2024
@AtkinsSJ AtkinsSJ marked this pull request as draft May 3, 2024 16:31
AtkinsSJ added 2 commits June 27, 2024 10:39
On self-hosted installs, several of these apps are not (currently)
available, meaning that `get_app()` would fail and we would get null
values in the suggested_apps array. Since the `/open_file` API endpoint
selects the first result, it could therefore think that there were no
available apps, when actually there were.

For example, source code files can be opened either in `code` or
`editor`. `code` is not available on self-hosted, so the first entry
would be null. This change removes that, so `editor` is rightly
selected.

Also, we have this `file_extension` variable, so let's use it. :^)
`open FILE|URL` opens the given file in the user's preferred app.

On Node, we rely on the system's built-in utility rather than attempt to
write our own code for figuring out what the preferred application is.

On Puter, `puter.ui.launchApp()` can't yet grant access to files, so
using `open` on Puter launches the app without the file open.

The other issue is that we need to make the app-launching code from the
CommandProviders available to coreutils and elsewhere, so that they can
interact with stdio without duplicating all the logic.
@AtkinsSJ AtkinsSJ marked this pull request as ready for review June 27, 2024 10:01
@AtkinsSJ
Copy link
Contributor Author

Marking this as ready, but it's still waiting for #481 to be properly useful.

@AtkinsSJ AtkinsSJ changed the title WIP: Add an 'open' utility to Phoenix Add an 'open' utility to Phoenix Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants