Commit 52a0b39 1 parent 9f406c6 commit 52a0b39 Copy full SHA for 52a0b39
File tree 2 files changed +2
-23
lines changed
2 files changed +2
-23
lines changed Original file line number Diff line number Diff line change 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
12
2
13
3
14
4
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 ()
Original file line number Diff line number Diff line change @@ -48,6 +48,3 @@ def transpile_file(path: Path) -> int:
48
48
path .with_suffix (".py" ).write_text (transpiled )
49
49
return 1
50
50
51
-
52
- if __name__ == "__main__" :
53
- cli ()
You can’t perform that action at this time.
0 commit comments