shlomif-computer-settings /shlomif-settings/Bash/Themes/common/bitbucket-hg-remote-repo.pl

Language Perl Lines 36
MD5 Hash aaab85524493bab3925f20825fbb17a7 Estimated Cost $585 (why?)
Repository https://bitbucket.org/shlomif/shlomif-computer-settings View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl

use strict;
use warnings;

use Getopt::Long qw(GetOptions);

my $auth = 1;

my $bb_user;
my $bb_repo;

GetOptions(
    'user=s' => \$bb_user,
    'repo=s' => \$bb_repo,
);

if (!defined ($bb_user))
{
    die "user not specified!";
}

if (!defined ($bb_repo))
{
    die "repo not specified!";
}

if (($ENV{BITBUCKET_USERS} || '') =~ m{,\Q$bb_user\E,})
{
    print "ssh://hg\@bitbucket.org/$bb_user/$bb_repo\n";
}
else
{
    print "https://bitbucket.org/$bb_user/$bb_repo\n";
}
Back to Top