aboutsummaryrefslogtreecommitdiff
path: root/src/performcmd.cpp
blob: d9b7977ec08734b2783f7939fa8cd51ac536b157 (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
#include "performcmd.h"
#include "builder.h"

PerformCmd::PerformCmd( const char *sCmd, const char *sTarget ) :
	Perform( sTarget ),
	sCommand( sCmd )
{
}

PerformCmd::~PerformCmd()
{
}

void PerformCmd::execute( class Builder &bld )
{
	printf("%s\n", sCommand.getString() );
	int ret;
	if( (ret = system( sCommand.getString() )) != 0 )
	{
		printf("Error code: %d\n", WEXITSTATUS(ret) );
		exit( WEXITSTATUS(ret) );
	}
}