mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 22:09:26 +01:00
Improve launching of modules
If a `workdir` factoid key is present, the launcher will chdir to make the specified value the current working directory. Redirect stderr output to a $modulename-stderr in the module's current working directory.
This commit is contained in:
parent
56a926603f
commit
12cd9cb8e0
@ -142,9 +142,11 @@ sub execute_module {
|
|||||||
Carp::croak("Could not chdir to '$module_dir': $!");
|
Carp::croak("Could not chdir to '$module_dir': $!");
|
||||||
}
|
}
|
||||||
|
|
||||||
# $self->{pbot}->{logger}->log("module arguments: [$arguments]\n");
|
if(exists $self->{pbot}->{factoids}->{factoids}->hash->{$channel}->{$trigger}->{workdir}) {
|
||||||
|
chdir $self->{pbot}->{factoids}->{factoids}->hash->{$channel}->{$trigger}->{workdir};
|
||||||
|
}
|
||||||
|
|
||||||
$text = `$module_dir/$module $arguments`;
|
$text = `./$module $arguments 2>> $module-stderr`;
|
||||||
|
|
||||||
if(defined $tonick) {
|
if(defined $tonick) {
|
||||||
$self->{pbot}->{logger}->log("($from): $nick!$user\@$host) sent to $tonick\n");
|
$self->{pbot}->{logger}->log("($from): $nick!$user\@$host) sent to $tonick\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user