From cca4f48f6d280a3f89660575f2e4388e49bee8a6 Mon Sep 17 00:00:00 2001 From: CaS Date: Fri, 14 May 2004 16:08:05 +0000 Subject: [PATCH] Create output directories if necesary. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19324 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Tools/autogsdoc.m | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3190bf7f5..b9a2bbb76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-05-14 Richard Frith-Macdonald + + * Tools/autogsdoc.m: Create output directories if necessary. + 2004-05-14 Richard Frith-Macdonald * Source/GSFormat.h: diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index 7b7b6eb96..ef7cb8ed8 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -831,6 +831,9 @@ main(int argc, char **argv, char **env) } } + mgr = [NSFileManager defaultManager]; + + verbose = [defs boolForKey: @"Verbose"]; warn = [defs boolForKey: @"Warn"]; ignoreDependencies = [defs boolForKey: @"IgnoreDependencies"]; @@ -865,6 +868,11 @@ main(int argc, char **argv, char **env) { documentationDirectory = @""; } + if ([documentationDirectory length] > 0 + && [mgr fileExistsAtPath: documentationDirectory] == NO) + { + [mgr createDirectoryAtPath: documentationDirectory attributes: nil]; + } proc = [NSProcessInfo processInfo]; if (proc == nil) @@ -935,8 +943,6 @@ main(int argc, char **argv, char **env) } } - mgr = [NSFileManager defaultManager]; - /* * 3) Load old project indexing information from the .igsdoc file if * present and determine when the indexing information was last @@ -2246,6 +2252,11 @@ main(int argc, char **argv, char **env) [depend appendFormat: @" \\\n\t%@", file]; } + file = [stamp stringByDeletingLastPathComponent]; + if ([file length]> 0 && [mgr fileExistsAtPath: file] == NO) + { + [mgr createDirectoryAtPath: file attributes: nil]; + } [depend writeToFile: stamp atomically: YES]; }