epita-std
/
ACU
Archived
1
0
Fork 0
This repository has been archived on 2021-10-08. You can view files and clone it, but cannot push or open issues or pull requests.
ACU/commands/project/gen_git_str.pl

36 lines
735 B
Perl

#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
use Data::Dumper;
use ACU::API::Projects;
my $projid = $ARGV[0];
my $year = $ARGV[1] // LDAP::get_year;
my $res = API::Projects::get_groups($projid, $year);
my $tag = "rendu-1";
map {
my $chief;
# First, found the chief
for my $member (@{ $_->{stds} })
{
if ($member->{chief} eq "true" or $member->{chief} eq "1" or $member->{chief} eq "chief")
{
$chief = $member;
last;
}
}
say "repo $year/$projid/$chief->{login}";
print ' RW+ = @admins';
for my $member (@{ $_->{stds} }) {
print ' '.$member->{login};
}
say "\n R = \@chefs \@resp-$year-$projid \@soutenance-$year-$projid";
} @{ $res->{groups} };