Added --ignore-nonexistent-config to allow integration with Pronterface even if config file doesn't exist
This commit is contained in:
parent
caf41f07dd
commit
fcb7f63c87
2 changed files with 10 additions and 4 deletions
|
@ -188,9 +188,11 @@ Put this into *slicecommand*:
|
|||
|
||||
And this into *sliceoptscommand*:
|
||||
|
||||
slic3r.pl --load config.ini
|
||||
slic3r.pl --load config.ini --ignore-nonexistent-config
|
||||
|
||||
Replace `slic3r.pl` with the full path to the slic3r executable.
|
||||
Replace `slic3r.pl` with the full path to the slic3r executable and `config.ini`
|
||||
with the full path of your config file (put it in your home directory or where
|
||||
you like).
|
||||
On Mac, the executable has a path like this:
|
||||
|
||||
/Applications/Slic3r.app/Contents/MacOS/slic3r
|
||||
|
|
|
@ -24,6 +24,7 @@ my %cli_options = ();
|
|||
|
||||
'save=s' => \$opt{save},
|
||||
'load=s' => \$opt{load},
|
||||
'ignore-nonexistent-config' => \$opt{ignore_nonexistent_config},
|
||||
);
|
||||
foreach my $opt_key (keys %$Slic3r::Config::Options) {
|
||||
my $opt = $Slic3r::Config::Options->{$opt_key};
|
||||
|
@ -36,8 +37,11 @@ my %cli_options = ();
|
|||
|
||||
# load configuration
|
||||
if ($opt{load}) {
|
||||
-e $opt{load} or die "Cannot find specified configuration file.\n";
|
||||
Slic3r::Config->load($opt{load});
|
||||
if (-e $opt{load}) {
|
||||
Slic3r::Config->load($opt{load});
|
||||
} else {
|
||||
$opt{ignore_nonexistent_config} or die "Cannot find specified configuration file.\n";
|
||||
}
|
||||
}
|
||||
|
||||
# validate command line options
|
||||
|
|
Loading…
Reference in a new issue