Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/GitLab/API/v4.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4105,6 +4105,7 @@ sub job_artifacts {
croak 'The #1 argument ($project_id) to job_artifacts must be a scalar' if ref($_[0]) or (!defined $_[0]);
croak 'The #2 argument ($job_id) to job_artifacts must be a scalar' if ref($_[1]) or (!defined $_[1]);
my $options = {};
$options->{decode} = 0;
return $self->_call_rest_client( 'GET', 'projects/:project_id/jobs/:job_id/artifacts', [@_], $options );
}

Expand Down
10 changes: 8 additions & 2 deletions script/gitlab-api-v4
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,17 @@ my $data = $api->$method(

$data = $data->all() if $all;

binmode STDOUT, ':utf8';
binmode STDOUT;
my $json = JSON::MaybeXS->new(allow_nonref => 1);
$json->pretty() if $pretty;
$json->canonical() if $canonical;
print $json->encode( $data );
if (ref($data) eq 'ARRAY') {
binmode STDOUT, ':utf8';
print $json->encode( $data );
}
else {
print $data;
}

__END__

Expand Down