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

Opening file in Light Table from command line? #87

Closed
k4y3ff opened this issue May 3, 2014 · 14 comments
Closed

Opening file in Light Table from command line? #87

k4y3ff opened this issue May 3, 2014 · 14 comments

Comments

@k4y3ff
Copy link
Member

k4y3ff commented May 3, 2014

A few times at the SF workshop, the curriculum/slides/TAs guided students to cd into a certain directory--leading to the natural question, "How do I open this file/directory in Light Table from the command line?"

We should either have the Light Table equivalent of subl added to the installfest, or rewrite the sections that refer to cding into directories in the curriculum.

@bridgethillyer
Copy link
Member

We should update the sections to refer to how to move around to files within Light Table.

@k4y3ff
Copy link
Member Author

k4y3ff commented Jul 17, 2014

+1 to that, as depending on the Light Table version, you may have to set up the light command separately, which would be confusing for beginners. Nonetheless, it's here, if anyone's curious:

https://github.com/LightTable/LightTable/blob/master/platform/mac/light

The Light Table mailing seemed to imply that light is automatically set up with the Mac installation (?), but I had to go through and configure this manually.

@seancorfield
Copy link
Contributor

FWIW, on Mac OS X, the following "just works":

/Applications/LightTable/light myfile.clj

If LightTable is not open, it will open it and load the file. If it is open, it will load the file.

@k4y3ff
Copy link
Member Author

k4y3ff commented Feb 7, 2015

An update, for anyone who wants to work on this issue: Probably, it would make sense to add information about one of the two above commands to the installfest instructions--maybe in the "Troubleshooting" section mentioned in #98 ?

Also, adding the information for all of the operating systems linked to here would be helpful, if possible.

@daveyarwood
Copy link

I use Light Table on OS X, and the following works great for opening files and folders from the command line:

open -a /Applications/LightTable/LightTable.app path/to/file.clj

You could easily add an alias for this so that you can open files by just typing light-table /path/to/file.

Apparently for the Linux version of Light Table, you can already open files by typing light-table path/to/file.clj.

I'd be happy to make a PR to add a step of aliasing open -a /Applications/LightTable/LightTable.app to light-table to the OS X install-fest instructions. Then the curriculum can just say, when appropriate, e.g. "Open the project folder in Light Table by typing light-table /some/project.

@k4y3ff
Copy link
Member Author

k4y3ff commented Apr 21, 2015

I'd be happy to make a PR to add a step of aliasing open -a /Applications/LightTable/LightTable.app to light-table to the OS X install-fest instructions.

Yes, that would be helpful! Though, we'd need to update the Linux and Windows docs simultaneously, as well?

Then the curriculum can just say, when appropriate, e.g. "Open the project folder in Light Table by typing light-table /some/project.

I should note that we generally avoid opening things from the command line in the actual curriculum, because people in many of the workshops aren't familiar with the command line, and that's kind-of a separate beast? This step would be more for intermediate-level folks, as well as optional.

@daveyarwood
Copy link

Ah, I see! That makes sense. So maybe it's best left as a minor note in the setup instructions, and note that it's optional.

Linux should be good-to-go, I think. I haven't verified this, but it appears that when you install Light Table on a Linux machine, it gives you an executable script called light-table, which can take a file/folder argument.

I didn't think about Windows... I have no idea how that works! From what I can tell, there is a LightTable.exe that you double click to open it, but I'm not really familiar with using Cygwin, PowerShell, etc., so not sure how a typical Windows developer would go about opening files from the command line.

@k4y3ff
Copy link
Member Author

k4y3ff commented Apr 21, 2015

Bah, yeah... I don't actually have access to a Windows machine, soooooo ¯_(ツ)_/¯

Though, you could totally still submit the Linux + OS X PR! And we could leave this issue open in the meantime? That or create a new issue that's Windows-specific.

@daveyarwood
Copy link

PR submitted! I vote that we close this issue and we can always create a new issue if the question ever comes up in the future about how to open files in LT from the command line in a particular Windows shell.

Also, here's your other arm, lol: \

@seancorfield
Copy link
Contributor

@daveyarwood did you try the command I suggested earlier in this thread:

/Applications/LightTable/light myfile.clj

That seems simpler than using open.

@daveyarwood
Copy link

@seancorfield when I try that command, the file does open up in LightTable, however I also see this error message in the terminal:

[19531:0421/182309:ERROR:breakpad_mac.mm(234)] Breakpad initializaiton failed

It also blocks the terminal until I hit Ctrl-C.

@seancorfield
Copy link
Contributor

Ah, good to know. OK, sounds like open is the better choice. Thanks!

@yokolet
Copy link
Member

yokolet commented Jun 3, 2015

The pull request was merged and the updated document is, https://github.com/ClojureBridge/curriculum/blob/gh-pages/outline/setup_osx.md
I'm going to close this issue.

@yokolet yokolet closed this as completed Jun 3, 2015
@daveyarwood
Copy link

Hi again -- I just realized I made a dumb mistake and used export instead of alias for the command to create the "light-table" alias in OSX... sorry about that! Another PR is on its way.

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

5 participants