Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Sort out CLI for Oni #2372

Merged
merged 12 commits into from
Jul 1, 2018
Merged

Sort out CLI for Oni #2372

merged 12 commits into from
Jul 1, 2018

Conversation

CrossR
Copy link
Member

@CrossR CrossR commented Jun 29, 2018

This PR aims to address some of the points outlined over in #1707.

The first thing I'm aiming to fix is the ability to launch in the background, by fixing/editing the existing launch script (well currently I've deleted the old one, but this is very WIP so I'm just seeing what works).

I've based it on the VSCode script that is outlined in the linked issue.

Todo:

  • Windows Script.
    • Look into double click issue (ie closing powershell takes two clicks of the close X?
  • Linux Script.
  • macOS Script (we do have one already, so I'll see about editing this etc)
  • Check existing functionality isn't changed:
    • Normal opening (Invoking Oni directly with a click)
    • Opening a file that Oni is registered for.
    • Opening a file via Edit with Oni (Windows only I think)
    • Launching via Dev.
  • Sort out the meshing of the current CLI functionality and the new changes, ensure swapping folders, opening files and such is okay with the change.

I'm considering the following but will probably just leave them to a second PR:

  • The updated workspace detection (may be simple enough when I'm checking/sorting the existing logic, so I'll see).
  • Add the option to pass neovim flags.
  • Instance management.

There is a very basic implementation I've done already that works on Windows, so seems like a good start, so hopefully it works across the other platforms.

@codecov
Copy link

codecov bot commented Jun 29, 2018

Codecov Report

Merging #2372 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2372      +/-   ##
=========================================
- Coverage   38.11%   38.1%   -0.01%     
=========================================
  Files         300     300              
  Lines       12519   12522       +3     
  Branches     1645    1646       +1     
=========================================
  Hits         4771    4771              
- Misses       7494    7497       +3     
  Partials      254     254
Impacted Files Coverage Δ
browser/src/Platform.ts 30% <0%> (-3.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5d42ee...6da1f7c. Read the comment docs.

@CrossR
Copy link
Member Author

CrossR commented Jun 29, 2018

Think the basics are done for the 3 platforms (at least from the very quick testing I did).

@CrossR CrossR changed the title [WIP] Sort out CLI for Oni Sort out CLI for Oni Jun 30, 2018
@CrossR
Copy link
Member Author

CrossR commented Jun 30, 2018

I've done a lot of testing with this on Windows, and bits on Mac/Linux, but I'd appreciate if anybody else could give it a test.

I'm going to ignore the powershell issue for now...since I couldn't find any mention of it elsewhere online.

@badosu probably worth you being aware of this since I know you maintain the AUR version of Oni, and this changes what is used to launch Oni to cli/linux/oni.sh.

@bryphe
Copy link
Member

bryphe commented Jun 30, 2018

Change looks great, @CrossR ! Thank you for all your work on this! 💯 I'm stoked that our CLI will finally be usable 👍 Really appreciate all the thought you put into this across all the platforms.

bryphe
bryphe previously approved these changes Jun 30, 2018
@CrossR
Copy link
Member Author

CrossR commented Jun 30, 2018

@bryphe, I've actually just realised that the Add to PATH functionality on macOS isn't hooked up.
Its probably best to address that here in a basic way so it can be tested more easily.

I'm aiming to just check the symbolic link and make sure it points to cli/mac/oni.sh. For something more stable, we might want a check like @Akin909 init.vim check, so when people launch they know to re-run Add To Path.

@bryphe
Copy link
Member

bryphe commented Jun 30, 2018

Thanks for catching that! That plan sounds reasonable to me. I'll tag this so I know to call it out in the release notes, as well 👍

@CrossR
Copy link
Member Author

CrossR commented Jun 30, 2018

Had a stupid logic error, but fixed that now and it works to add to the path on mac.

I'll leave potentially adding an on launch check to a later PR, I'd rather stick with the CLI stuff whilst I'm in the area.

@bryphe
Copy link
Member

bryphe commented Jul 1, 2018

Had a stupid logic error, but fixed that now and it works to add to the path on mac.

Ah I missed that too when I looked at the code! Glad you caught it.

I'll leave potentially adding an on launch check to a later PR, I'd rather stick with the CLI stuff whilst I'm in the area.

Sure, sounds reasonable as a separate PR - this change looks great 👍

@badosu
Copy link
Collaborator

badosu commented Jul 1, 2018

@CrossR I'll check for CLI for any problems with the AUR wrapper script.

De we have a standard interface that I can check list? Nothing high level, just the most important bits, e.g. *What happen when oni ... is run`.

Thanks!
PS: Assuming the scope is CLI invocation only.

@CrossR
Copy link
Member Author

CrossR commented Jul 1, 2018

De we have a standard interface that I can check list? Nothing high level, just the most important bits, e.g. *What happen when oni ... is run`.

Not really right now, and to be honest it will hopefully be changing in the next few PRs to match what #1707 has outlined, so it probably makes more sense for the documentation to wait until I'm done.

All this PR should change is that you can close the terminal without closing Oni now. Everything else should be the same as the previous versions of Oni from the CLI. Non-CLI launching shouldn't have been changed at all.

@CrossR CrossR merged commit 8919a86 into onivim:master Jul 1, 2018
bryphe added a commit that referenced this pull request Jul 10, 2018
* Gate tests to only run on Windows

* Fix lint issues

* Hook up setup tests to run as part of 'yarn run test'

* Run setup tests on appveyor; don't run as part of 'yarn run test'

* Uncomment out test that registry key is removed, since Ryan's changes now address that!

* Fix lint issues

* Increase timeout

* Include arch for setup file path

* Include arch for setup file

* Fix up arch on appveyor

* Fix lint issues
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants