Skip to content

Commit

Permalink
only mkdir if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
poeticAndroid committed Aug 1, 2019
1 parent 5c048d0 commit 77bc38a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions source/machine.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import soundchip;
import pixmap;
import image_loader;

const VERSION = "0.2.7"; /// version of the software
const VERSION = "0.2.8"; /// version of the software

/**
Class representing "the machine"!
Expand Down Expand Up @@ -290,8 +290,14 @@ class Machine
path = absolutePath(path);
if (this.drives.get(name, null))
throw new Exception("Drive '" ~ name ~ "' already mounted!");
if (!exists(path) || !isDir(path))
mkdirRecurse(path);
try
{
if (!exists(path))
mkdirRecurse(path);
}
catch (Exception err)
{
}
if (path[$ - 1 .. $] != dirSeparator)
path ~= dirSeparator;
this.drives[name] = path;
Expand Down

0 comments on commit 77bc38a

Please sign in to comment.