mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
edit: enable Sublime Text project view
This commit is contained in:
parent
bdc3391a13
commit
04c8e896a5
4
.gitignore
vendored
4
.gitignore
vendored
@ -194,5 +194,7 @@
|
|||||||
# Unignore tests' bundle config
|
# Unignore tests' bundle config
|
||||||
!/Library/Homebrew/test/.bundle/config
|
!/Library/Homebrew/test/.bundle/config
|
||||||
|
|
||||||
# Unignore vscode configuration
|
# Unignore editor configuration
|
||||||
|
!/.sublime
|
||||||
|
/.sublime/homebrew.sublime-workspace
|
||||||
!/.vscode
|
!/.vscode
|
||||||
|
28
.sublime/homebrew.sublime-project
Normal file
28
.sublime/homebrew.sublime-project
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"folders":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"//": "Generated based on the contents of our .gitignore",
|
||||||
|
"path": "..",
|
||||||
|
"folder_exclude_patterns": [
|
||||||
|
"Caskroom",
|
||||||
|
"Cellar",
|
||||||
|
"Frameworks",
|
||||||
|
"bin",
|
||||||
|
"etc",
|
||||||
|
"include",
|
||||||
|
"lib",
|
||||||
|
"opt",
|
||||||
|
"sbin",
|
||||||
|
"share",
|
||||||
|
"var",
|
||||||
|
"Library/Homebrew/LinkedKegs",
|
||||||
|
"Library/Homebrew/Aliases"
|
||||||
|
],
|
||||||
|
"follow_symlinks": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"tab_size": 2
|
||||||
|
}
|
||||||
|
}
|
@ -40,16 +40,24 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
paths = args.named.to_paths.select do |path|
|
paths = if args.named.empty?
|
||||||
next path if path.exist?
|
# Sublime requires opting into the project editing path,
|
||||||
|
# as opposed to VS Code which will infer from the .vscode path
|
||||||
|
if which_editor == "subl"
|
||||||
|
["--project", "#{HOMEBREW_REPOSITORY}/.sublime/homebrew.sublime-project"]
|
||||||
|
else
|
||||||
|
# If no formulae are listed, open the project root in an editor.
|
||||||
|
[HOMEBREW_REPOSITORY]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
args.named.to_paths.select do |path|
|
||||||
|
next path if path.exist?
|
||||||
|
|
||||||
raise UsageError, "#{path} doesn't exist on disk. " \
|
raise UsageError, "#{path} doesn't exist on disk. " \
|
||||||
"Run #{Formatter.identifier("brew create --set-name #{path.basename} $URL")} " \
|
"Run #{Formatter.identifier("brew create --set-name #{path.basename} $URL")} " \
|
||||||
"to create a new formula!"
|
"to create a new formula!"
|
||||||
end.presence
|
end.presence
|
||||||
|
end
|
||||||
# If no formulae are listed, open the project root in an editor.
|
|
||||||
paths ||= [HOMEBREW_REPOSITORY]
|
|
||||||
|
|
||||||
exec_editor(*paths)
|
exec_editor(*paths)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user