line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Provision::Homebrew; |
2
|
|
|
|
|
|
|
$App::Provision::Homebrew::VERSION = '0.0404'; |
3
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:GENE'; |
4
|
1
|
|
|
1
|
|
922
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
41
|
|
6
|
1
|
|
|
1
|
|
371
|
use parent qw( App::Provision::Tiny ); |
|
1
|
|
|
|
|
292
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
52
|
use File::Which; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
267
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub deps |
11
|
|
|
|
|
|
|
{ |
12
|
0
|
|
|
0
|
1
|
|
return qw( curl ); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub condition |
17
|
|
|
|
|
|
|
{ |
18
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# Reset the program name. |
21
|
0
|
|
|
|
|
|
$self->{program} = 'brew'; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
0
|
0
|
|
|
my $callback = shift || sub { which($self->{program}) }; |
|
0
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $condition = $callback->(); |
25
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
warn $self->{program}, ' is', ($condition ? '' : "n't"), " installed\n"; |
27
|
|
|
|
|
|
|
|
28
|
0
|
0
|
|
|
|
|
return $condition ? 1 : 0; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub meet |
33
|
|
|
|
|
|
|
{ |
34
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
35
|
0
|
0
|
|
|
|
|
if ($self->{system} eq 'osx' ) |
|
|
0
|
|
|
|
|
|
36
|
|
|
|
|
|
|
{ |
37
|
0
|
|
|
|
|
|
$self->recipe( |
38
|
|
|
|
|
|
|
[ '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' ], |
39
|
|
|
|
|
|
|
[ 'brew', 'doctor' ], |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
elsif ($self->{system} eq 'apt' ) |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
|
|
|
$self->recipe( |
45
|
|
|
|
|
|
|
[ 'sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"' ], |
46
|
|
|
|
|
|
|
[ 'test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)' ], |
47
|
|
|
|
|
|
|
[ 'test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' ], |
48
|
|
|
|
|
|
|
[ 'test -r ~/.profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile' ], |
49
|
|
|
|
|
|
|
[ 'echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile' ], |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |