From 65e278b28671640610354606ad6f1b11bd4a22bd Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 9 Jun 2024 16:20:54 -0700 Subject: [PATCH] Don't pollute the source directory --- support/mkdocs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/support/mkdocs b/support/mkdocs index e3349a6c..d18302f3 100755 --- a/support/mkdocs +++ b/support/mkdocs @@ -30,9 +30,13 @@ if len(args) > 0: 'git@github.com:fmtlib/fmt.dev.git', site_dir]) if ret != 0: sys.exit(ret) - sys.exit(call(['mike'] + args + ['--config-file', config_path, - '--branch', 'master'], - cwd=site_dir, env=env)) + + # Copy the config to the build dir because the site is built relative to it. + config_build_path = os.path.join(build_dir, 'mkdocs.yml') + shutil.copyfile(config_path, config_build_path) + + sys.exit(call(['mike'] + args + ['--config-file', config_build_path, + '--branch', 'master'], cwd=site_dir, env=env)) elif not command.startswith('-'): args += ['-f', config_path] sys.exit(call(['mkdocs'] + args, env=env))