Skip to content

Commit 0cf38cb

Browse files
authored
Use temporary folder for output in update-all-link-reference command (#967)
* Use temporary folder for output in update-all-link-reference command * Revert
1 parent 7acb183 commit 0cf38cb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/docs-assembler/Cli/RepositoryCommands.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,21 @@ await Parallel.ForEachAsync(repositories,
154154
{
155155
var name = kv.Key.Trim();
156156
var checkout = cloner.CloneOrUpdateRepository(kv.Value, name, kv.Value.GetBranch(contentSource), dict);
157-
158-
var docsMetadataPath = Path.Combine(checkout.Directory.FullName, ".docs-metadata");
159-
157+
var outputPath = Directory.CreateTempSubdirectory(checkout.Repository.Name).FullName;
160158
var context = new BuildContext(
161159
collector,
162160
new FileSystem(),
163161
new FileSystem(),
164162
checkout.Directory.FullName,
165-
docsMetadataPath
163+
outputPath
166164
);
167165
var set = new DocumentationSet(context, logger);
168166
var generator = new DocumentationGenerator(set, logger, null, null, new NoopDocumentationFileExporter());
169167
await generator.GenerateAll(c);
170168

171169
IAmazonS3 s3Client = new AmazonS3Client();
172170
const string bucketName = "elastic-docs-link-index";
173-
var linksJsonPath = Path.Combine(docsMetadataPath, "links.json");
171+
var linksJsonPath = Path.Combine(outputPath, "links.json");
174172
var content = await File.ReadAllTextAsync(linksJsonPath, c);
175173
var putObjectRequest = new PutObjectRequest
176174
{

0 commit comments

Comments
 (0)