Skip to content

Commit

Permalink
Make the compile script executable
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Mar 5, 2022
1 parent c0df734 commit 79f31ec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Icon*
/site/
/*.html
/docs/*.png
texput.log

# Google Drive
*.gdoc
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ DOORSTOP := poetry run doorstop
YAML := $(wildcard */*.yml */*/*.yml */*/*/*/*.yml)

.PHONY: reqs
reqs: doorstop reqs-html reqs-latex reqs-md reqs-txt
reqs: doorstop reqs-html reqs-latex reqs-md reqs-pdf reqs-txt

.PHONY: reqs-html
reqs-html: install docs/gen/*.html
Expand All @@ -167,6 +167,10 @@ reqs-md: install docs/gen/*.md
docs/gen/*.md: $(YAML)
$(DOORSTOP) publish all docs/gen --markdown

.PHONY: reqs-pdf
reqs-pdf: reqs-latex
cd docs/gen && ./compile.sh

.PHONY: reqs-txt
reqs-txt: install docs/gen/*.txt
docs/gen/*.txt: $(YAML)
Expand Down
4 changes: 3 additions & 1 deletion doorstop/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def load_yaml(text, path, loader=yaml.SafeLoader):
return data


def write_lines(lines, path, end="\n", encoding="utf-8"):
def write_lines(lines, path, end="\n", encoding="utf-8", *, executable=False):
"""Write lines of text to a file.
:param lines: iterator of strings
Expand All @@ -158,6 +158,8 @@ def write_lines(lines, path, end="\n", encoding="utf-8"):
for line in lines:
data = (line + end).encode(encoding)
stream.write(data)
if executable and os.path.isfile(path):
os.chmod(path, 0o775)
return path


Expand Down
2 changes: 1 addition & 1 deletion doorstop/core/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def publish(
log.info("Copied assets from %s to %s", obj.assets, assets_dir)

if ext == ".tex":
common.write_lines(compile_files, compile_path)
common.write_lines(compile_files, compile_path, executable=True)
msg = "You can now execute the file 'compile.sh' twice in the exported folder to produce the PDFs!"
utilities.show(msg, flush=True)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]

name = "doorstop"
version = "3.0b1"
version = "3.0b2"
description = "Requirements management using version control."

license = "LGPLv3"
Expand Down

0 comments on commit 79f31ec

Please sign in to comment.