mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-05 14:55:06 +08:00
Bugfix: wizard wasn't run when user supplied an existing empty directory as --datadir
This commit is contained in:
parent
fed8783e30
commit
7e3425d433
@ -82,7 +82,10 @@ sub OnInit {
|
|||||||
$datadir ||= Wx::StandardPaths::Get->GetUserDataDir;
|
$datadir ||= Wx::StandardPaths::Get->GetUserDataDir;
|
||||||
$datadir = Slic3r::encode_path($datadir);
|
$datadir = Slic3r::encode_path($datadir);
|
||||||
Slic3r::debugf "Data directory: %s\n", $datadir;
|
Slic3r::debugf "Data directory: %s\n", $datadir;
|
||||||
my $run_wizard = (-d $datadir) ? 0 : 1;
|
|
||||||
|
# just checking for existence of $datadir is not enough: it may be an empty directory
|
||||||
|
# supplied as argument to --datadir; in that case we should still run the wizard
|
||||||
|
my $run_wizard = (-d $datadir && -e "$datadir/slic3r.ini") ? 0 : 1;
|
||||||
for ($datadir, "$datadir/print", "$datadir/filament", "$datadir/printer") {
|
for ($datadir, "$datadir/print", "$datadir/filament", "$datadir/printer") {
|
||||||
mkdir or $self->fatal_error("Slic3r was unable to create its data directory at $_ (errno: $!).")
|
mkdir or $self->fatal_error("Slic3r was unable to create its data directory at $_ (errno: $!).")
|
||||||
unless -d $_;
|
unless -d $_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user