Skip to content

Commit 53bee6a

Browse files
Add build scripts
1 parent 3be49a7 commit 53bee6a

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

tools/build_web.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
python web/wikigen.py build

tools/build_web.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
python web/wikigen.py build

web/scripts/builder.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111

1212
import scripts.utils as utils
1313

14-
DOCS_REPO_PATH = os.path.abspath(os.path.join(os.getcwd(), "../"))
15-
16-
INPUT_RESOURCES_PATH = os.path.join(os.getcwd(), "resources/")
17-
OUTPUT_HTML_FOLDER = "output/html"
18-
OUTPUT_HTML_PATH = os.path.join(os.getcwd(), OUTPUT_HTML_FOLDER)
14+
DOCS_REPO_PATH = os.getcwd() # Repository root
15+
INPUT_RESOURCES_PATH = os.path.join(DOCS_REPO_PATH, "web/resources")
16+
OUTPUT_HTML_PATH = os.path.join(DOCS_REPO_PATH, "web/output/html")
1917

2018
class WikiBuilderError(Exception):
2119
def __init__(self, message):
@@ -27,6 +25,10 @@ def __init__(self, logger):
2725
self.logger = logger
2826
self.logger.info('Initializing WikiBuilder')
2927

28+
parent_folder = os.path.basename(os.path.dirname(DOCS_REPO_PATH))
29+
if parent_folder == 'web' or parent_folder == 'tools':
30+
raise WikiBuilderError('ABORTING! Script must be executed from the root directory of the repository!')
31+
3032
def build(self):
3133
self.clear()
3234

0 commit comments

Comments
 (0)