mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-21 23:54:25 +08:00
Expose all SLIC3R_* environment variables as placeholders. #781
This commit is contained in:
parent
580e36eb25
commit
a5a0f32e19
@ -1156,9 +1156,11 @@ sub replace_options {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($string, $more_variables) = @_;
|
my ($string, $more_variables) = @_;
|
||||||
|
|
||||||
if ($more_variables) {
|
$more_variables ||= {};
|
||||||
my $variables = join '|', keys %$more_variables;
|
$more_variables->{$_} = $ENV{$_} for grep /^SLIC3R_/, keys %ENV;
|
||||||
$string =~ s/\[($variables)\]/$more_variables->{$1}/eg;
|
{
|
||||||
|
my $variables_regex = join '|', keys %$more_variables;
|
||||||
|
$string =~ s/\[($variables_regex)\]/$more_variables->{$1}/eg;
|
||||||
}
|
}
|
||||||
|
|
||||||
my @lt = localtime; $lt[5] += 1900; $lt[4] += 1;
|
my @lt = localtime; $lt[5] += 1900; $lt[4] += 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user