fix: create directory if doesn't exist, before error

This commit is contained in:
Connor Tumbleson 2019-04-24 18:45:57 -04:00
parent d1b0025c4e
commit 2e75f7b799

View File

@ -924,17 +924,6 @@ final public class AndrolibResources {
} else {
path = parentPath.getAbsolutePath() + String.format("%1$s.local%1$sshare%1$sapktool%1$sframework", File.separatorChar);
}
File fullPath = new File(path);
if (! fullPath.canWrite()) {
LOGGER.severe(String.format("WARNING: Could not write to (%1$s), using %2$s instead...",
fullPath.getAbsolutePath(), System.getProperty("java.io.tmpdir")));
LOGGER.severe("Please be aware this is a volatile directory and frameworks could go missing, " +
"please utilize --frame-path if the default storage directory is unavailable");
path = new File(System.getProperty("java.io.tmpdir")).getAbsolutePath();
}
}
File dir = new File(path);
@ -956,6 +945,17 @@ final public class AndrolibResources {
}
}
if (apkOptions.frameworkFolderLocation == null) {
if (! dir.canWrite()) {
LOGGER.severe(String.format("WARNING: Could not write to (%1$s), using %2$s instead...",
dir.getAbsolutePath(), System.getProperty("java.io.tmpdir")));
LOGGER.severe("Please be aware this is a volatile directory and frameworks could go missing, " +
"please utilize --frame-path if the default storage directory is unavailable");
dir = new File(System.getProperty("java.io.tmpdir"));
}
}
mFrameworkDirectory = dir;
return dir;
}