Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
907ac796
Commit
907ac796
authored
11 years ago
by
Adam Vandenberg
Browse files
Options
Downloads
Patches
Plain Diff
make linkapps official
parent
e8a89206
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Contributions/cmd/brew-linkapps.rb
+0
-31
0 additions, 31 deletions
Library/Contributions/cmd/brew-linkapps.rb
Library/Homebrew/cmd/linkapps.rb
+36
-0
36 additions, 0 deletions
Library/Homebrew/cmd/linkapps.rb
with
36 additions
and
31 deletions
Library/Contributions/cmd/brew-linkapps.rb
deleted
100755 → 0
+
0
−
31
View file @
e8a89206
# Links any Applications (.app) found in installed prefixes to /Applications
require
'keg'
TARGET_DIR
=
ARGV
.
include?
(
"--local"
)
?
File
.
expand_path
(
"~/Applications"
)
:
"/Applications"
unless
File
.
exist?
TARGET_DIR
opoo
"
#{
TARGET_DIR
}
does not exist, stopping."
puts
"Run `mkdir
#{
TARGET_DIR
}
` first."
exit
1
end
HOMEBREW_CELLAR
.
subdirs
.
each
do
|
rack
|
kegs
=
rack
.
subdirs
.
map
{
|
d
|
Keg
.
new
(
d
)
}
next
if
kegs
.
empty?
keg
=
kegs
.
detect
(
&
:linked?
)
||
kegs
.
max
{
|
a
,
b
|
a
.
version
<=>
b
.
version
}
Dir
[
"
#{
keg
}
/*.app"
,
"
#{
keg
}
/bin/*.app"
,
"
#{
keg
}
/libexec/*.app"
].
each
do
|
app
|
puts
"Linking
#{
app
}
"
app_name
=
File
.
basename
(
app
)
target
=
"
#{
TARGET_DIR
}
/
#{
app_name
}
"
if
File
.
exist?
(
target
)
&&
!
File
.
symlink?
(
target
)
onoe
"
#{
target
}
already exists, skipping."
next
end
system
"ln"
,
"-sf"
,
app
,
TARGET_DIR
end
end
puts
"Finished linking. Find the links under
#{
TARGET_DIR
}
."
This diff is collapsed.
Click to expand it.
Library/Homebrew/cmd/linkapps.rb
0 → 100755
+
36
−
0
View file @
907ac796
# Links any Applications (.app) found in installed prefixes to /Applications
require
'keg'
module
Homebrew
extend
self
def
linkapps
target_dir
=
ARGV
.
include?
(
"--local"
)
?
File
.
expand_path
(
"~/Applications"
)
:
"/Applications"
unless
File
.
exist?
target_dir
opoo
"
#{
target_dir
}
does not exist, stopping."
puts
"Run `mkdir
#{
target_dir
}
` first."
exit
1
end
HOMEBREW_CELLAR
.
subdirs
.
each
do
|
rack
|
kegs
=
rack
.
subdirs
.
map
{
|
d
|
Keg
.
new
(
d
)
}
next
if
kegs
.
empty?
keg
=
kegs
.
detect
(
&
:linked?
)
||
kegs
.
max
{
|
a
,
b
|
a
.
version
<=>
b
.
version
}
Dir
[
"
#{
keg
}
/*.app"
,
"
#{
keg
}
/bin/*.app"
,
"
#{
keg
}
/libexec/*.app"
].
each
do
|
app
|
puts
"Linking
#{
app
}
"
app_name
=
File
.
basename
(
app
)
target
=
"
#{
target_dir
}
/
#{
app_name
}
"
if
File
.
exist?
(
target
)
&&
!
File
.
symlink?
(
target
)
onoe
"
#{
target
}
already exists, skipping."
next
end
system
"ln"
,
"-sf"
,
app
,
target_dir
end
end
puts
"Finished linking. Find the links under
#{
target_dir
}
."
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment