Skip to content

Commit af096c1

Browse files
committed
Update -m invocation
1 parent 9f406c6 commit af096c1

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

pyjsx/__main__.py

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
1-
import sys
2-
from pathlib import Path
3-
4-
from pyjsx import transpile
5-
6-
7-
def transpile_file(f: Path) -> None:
8-
print("Transpiling", f) # noqa: T201
9-
source = f.read_text("utf-8")
10-
new_file = f.parent / f"{f.stem}_transpiled{f.suffix}"
11-
new_file.write_text(transpile(source))
1+
from pyjsx.cli import cli
122

133

144
if __name__ == "__main__":
15-
for p in sys.argv[1:]:
16-
path = Path(p)
17-
if not path.exists():
18-
continue
19-
if path.is_dir():
20-
for f in path.rglob("*.py"):
21-
transpile_file(f)
22-
else:
23-
transpile_file(path)
5+
cli()

0 commit comments

Comments
 (0)