aboutsummaryrefslogtreecommitdiff
path: root/src/performcommand.cpp
blob: 65827c5486f21b4bd06691f8e4f91746ef937d45 (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
32
33
34
35
#include "performcommand.h"
#include "bu/plugger.h"
#include "build.h"
#include "viewer.h"

#include <stdlib.h>

PluginInterface2(command, PerformCommand, Perform, "Mike Buland", 0, 1 );

PerformCommand::PerformCommand()
{
}

PerformCommand::~PerformCommand()
{
}

Perform *PerformCommand::duplicate( Build &bld, const StringList *cont, VarMap *mExtra )
{
	Perform *pRet = new PerformCommand();
	pRet->copyData( this, bld, cont, mExtra );
	return pRet;
}

void PerformCommand::execute( Build &bld )
{
	bld.getView()->executeCmd( lParam.front() );
	int n = system( lParam.front().c_str() );
	if( n != 0 )
		throw BuildException(
			"Command exited with error code %d.",
			WEXITSTATUS(n)
			);
}