File tree 3 files changed +48
-10
lines changed
3 files changed +48
-10
lines changed Original file line number Diff line number Diff line change 194
194
# Unignore tests' bundle config
195
195
! /Library /Homebrew /test /.bundle /config
196
196
197
- # Unignore vscode configuration
197
+ # Unignore editor configuration
198
+ ! /.sublime
199
+ /.sublime /homebrew.sublime-workspace
198
200
! /.vscode
Original file line number Diff line number Diff line change
1
+ {
2
+ "folders" :
3
+ [
4
+ {
5
+ "//" : " Generated based on the contents of our .gitignore" ,
6
+ "path" : " .." ,
7
+ "folder_exclude_patterns" : [
8
+ " Caskroom" ,
9
+ " Cellar" ,
10
+ " Frameworks" ,
11
+ " bin" ,
12
+ " etc" ,
13
+ " include" ,
14
+ " lib" ,
15
+ " opt" ,
16
+ " sbin" ,
17
+ " share" ,
18
+ " var" ,
19
+ " Library/Homebrew/LinkedKegs" ,
20
+ " Library/Homebrew/Aliases"
21
+ ],
22
+ "follow_symlinks" : true
23
+ }
24
+ ],
25
+ "settings" : {
26
+ "tab_size" : 2
27
+ }
28
+ }
Original file line number Diff line number Diff line change @@ -40,16 +40,24 @@ def edit
40
40
EOS
41
41
end
42
42
43
- paths = args . named . to_paths . select do |path |
44
- next path if path . exist?
43
+ paths = if args . named . empty?
44
+ # Sublime requires opting into the project editing path,
45
+ # as opposed to VS Code which will infer from the .vscode path
46
+ if which_editor == "subl"
47
+ [ "--project" , "#{ HOMEBREW_REPOSITORY } /.sublime/homebrew.sublime-project" ]
48
+ else
49
+ # If no formulae are listed, open the project root in an editor.
50
+ [ HOMEBREW_REPOSITORY ]
51
+ end
52
+ else
53
+ args . named . to_paths . select do |path |
54
+ next path if path . exist?
45
55
46
- raise UsageError , "#{ path } doesn't exist on disk. " \
47
- "Run #{ Formatter . identifier ( "brew create --set-name #{ path . basename } $URL" ) } " \
48
- "to create a new formula!"
49
- end . presence
50
-
51
- # If no formulae are listed, open the project root in an editor.
52
- paths ||= [ HOMEBREW_REPOSITORY ]
56
+ raise UsageError , "#{ path } doesn't exist on disk. " \
57
+ "Run #{ Formatter . identifier ( "brew create --set-name #{ path . basename } $URL" ) } " \
58
+ "to create a new formula!"
59
+ end . presence
60
+ end
53
61
54
62
exec_editor ( *paths )
55
63
end
You can’t perform that action at this time.
0 commit comments