File: Process_cmd.pm

package info (click to toggle)
transdecoder 5.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 29,088 kB
  • sloc: perl: 11,574; python: 271; sh: 147; makefile: 73
file content (40 lines) | stat: -rwxr-xr-x 485 bytes parent folder | download | duplicates (7)
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
36
37
38
39
40
package Process_cmd;

use strict;
use warnings;
use Carp;
use Cwd;

require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(process_cmd ensure_full_path);


sub process_cmd {
	my ($cmd) = @_;

	print STDERR "CMD: $cmd\n";

	my $ret = system($cmd);
	if ($ret) {
		confess "Error, cmd:\n$cmd\n died with ret ($ret)";
	}

	return;
}


sub ensure_full_path {
    my ($path) = @_;

    unless ($path =~ m|^/|) {
        $path = cwd() . "/$path";
    }

    return($path);
}



1; #EOM