From d03afbbd84a65dcc8a11b1c4a6213346ab2fd7c4 Mon Sep 17 00:00:00 2001 From: Asher Baker Date: Fri, 17 May 2013 14:48:52 +0100 Subject: [PATCH] Create dumps directory if it doesn't exist. --- buildbot/PackageScript | 2 +- extension/extension.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/buildbot/PackageScript b/buildbot/PackageScript index 4c51bef..3299f30 100644 --- a/buildbot/PackageScript +++ b/buildbot/PackageScript @@ -67,7 +67,7 @@ class CopyFile(Command): shutil.copy(self.fromFile, self.toPath) -folders = [['addons', 'sourcemod', 'extensions'], ['addons', 'sourcemod', 'data', 'dumps']] +folders = [['addons', 'sourcemod', 'extensions']] #Setup job.AddCommand(DestroyPath(os.path.join(AMBuild.outputFolder, 'package'))) diff --git a/extension/extension.cpp b/extension/extension.cpp index 1298f38..962b928 100644 --- a/extension/extension.cpp +++ b/extension/extension.cpp @@ -136,6 +136,16 @@ bool Accelerator::SDK_OnLoad(char *error, size_t maxlength, bool late) g_pSM->BuildPath(Path_SM, buffer, 255, "data/dumps"); + if (!libsys->IsPathDirectory(buffer)) + { + if (!libsys->CreateFolder(buffer)) + { + if (error) + g_pSM->Format(error, maxlength, "%s didn't exist and we couldn't create it :(", buffer); + return false; + } + } + google_breakpad::MinidumpDescriptor descriptor(buffer); handler = new google_breakpad::ExceptionHandler(descriptor, NULL, dumpCallback, NULL, true, -1);