Skip to content

Commit

Permalink
Small path-related changes to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dabico committed Feb 2, 2024
1 parent 31097b2 commit a4be97f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
parser.add_argument(
"-o",
"--output",
default=f"{__location__}/TreeSitter.java",
default=path(__location__, "TreeSitter.java"),
help="Output file path.",
)
args = parser.parse_args()
path = args.output
cmd = ["git", "submodule", "status", f"{__location__}/tree-sitter"]
output = args.output
submodule = path(__location__, "tree-sitter")
cmd = ["git", "submodule", "status", submodule]
status = run(cmd, capture_output=True, text=True)
sha, tag = match(pattern, status.stdout).groups()
content = f"""/*
Expand Down Expand Up @@ -76,5 +77,5 @@
}}
}}
"""
with open(path, "w") as file:
with open(output, "w") as file:
file.write(content)
2 changes: 1 addition & 1 deletion properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def write(self, outfile):
parser.add_argument(
"-o",
"--output",
default=f"{__location__}/language.properties",
default=path(__location__, "language.properties"),
help="Output file path.",
)
args = parser.parse_args()
Expand Down

0 comments on commit a4be97f

Please sign in to comment.