Last active
August 29, 2015 14:22
-
-
Save aapis/f7d3abc742adaf592cfd to your computer and use it in GitHub Desktop.
Open a bunch of files in a new Sublime Text window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open_files(){/path/to/sublime_open_files_in_new_window.rb ${@}} | |
| # Usage | |
| open_files test.rb main.c load.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/ruby | |
| project_home = '/path/to/a/dir' | |
| log_file = 'some/log/file.log' | |
| if ARGV.size == 0 | |
| # pull file list from a log file | |
| files = IO.readlines(log_file) | |
| files.each do |l| | |
| l.gsub!(/\r\n?/, "") | |
| l.prepend(project_home) | |
| end | |
| else | |
| # pull file list from CLI args | |
| files = ARGV | |
| end | |
| `subl -n #{files.join(' ')}` | |
| puts "Opened #{files.size} files in sublime text" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment