Skip to content

Commit

Permalink
Do resetOutputDir before Fs analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun-menon committed Jul 30, 2024
1 parent ba696a4 commit c406334
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions alteza/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,7 @@ def walk(curDir: DirNode) -> None:
else:
Generate.linkStaticAsset(fileNode, args.copy_assets)

outputDir = args.output
Generate.resetOutputDir(outputDir, args.clear_output_dir)

print("Generating...")
with enterDir(outputDir):
with enterDir(args.output):
walk(content.rootDir)


Expand All @@ -408,6 +404,8 @@ def run(args: Args) -> None:
f"The provided path '{contentDir}' does not exist or is not a directory."
)

Generate.resetOutputDir(args.output, args.clear_output_dir)

with enterDir(args.content):
fs = Fs()
print(fs.nameRegistry)
Expand All @@ -419,6 +417,7 @@ def run(args: Args) -> None:
print("File Tree:")
print(fs.rootDir.displayDir())

print("Generating...")
Generate.generate(args, content)

elapsedMilliseconds = (time.time_ns() - startTimeNs) / 10**6
Expand Down

0 comments on commit c406334

Please sign in to comment.