summaryrefslogtreecommitdiffstats
path: root/lib/Devscripts/Utils.pm
blob: 8495ce481d1cf8524e82e6b54f30564b2a8fb137 (plain)
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
package Devscripts::Utils;

use strict;
use Devscripts::Output;
use Exporter 'import';
use IPC::Run qw(run);

our @EXPORT = qw(ds_exec ds_exec_no_fail);

sub ds_exec_no_fail {
    {
        local $, = ' ';
        ds_debug "Execute: @_...";
    }
    run \@_, '>', '/dev/null';
    return $?;
}

sub ds_exec {
    {
        local $, = ' ';
        ds_debug "Execute: @_...";
    }
    run \@_;
    if ($?) {
        local $, = ' ';
        ds_die "Command failed (@_)";
    }
}

1;