Skip to content

Commit 7b61acf

Browse files
committed
Resolve the includes dir relative to the runcmd script location
1 parent 9674a51 commit 7b61acf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cwl/sphinx/runcmd.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import csv
2+
import os
23
import re
34
import shlex
45
import subprocess
56
import sys
67

8+
from pathlib import Path
9+
710
from docutils.parsers.rst import directives
811
from sphinx.directives import code
912

@@ -116,7 +119,9 @@ def run(self):
116119
# change to that working directory before running the desired command.
117120
# The working directory is omitted from the final output.
118121
# TODO: PATCHED
119-
working_directory = self.options.get('working-directory', 'src/_includes/cwl/')
122+
here = os.path.dirname(os.path.realpath(__file__))
123+
includes_dir = Path(here, '../../src/_includes/cwl/').resolve()
124+
working_directory = self.options.get('working-directory', includes_dir)
120125
if working_directory == '':
121126
# subprocess default value, so that we can disable it if needed.
122127
working_directory = None

0 commit comments

Comments
 (0)