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

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

PerformCmd::~PerformCmd()
{
}

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