File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change 1- from lib2to3 .pgen2 .token import OP
21import os
3- from turtle import fd
2+ import sys
43
54# Change this values according to your Project.
65ModuleName = os .path .split (os .path .split (__file__ )[0 ])[1 ]
1211
1312ScriptName = os .path .split (__file__ )[1 ]
1413
15- # Check name
16- if ' ' in ModuleName :
17- raise NameError ("Module name have space." )
18- elif ModuleName == 'Magisk-Module-Template' :
19- raise NotImplementedError ()
14+ dryRun = "--dry-run" in sys .argv
15+
16+ if not dryRun :
17+ # Check name
18+ if ' ' in ModuleName :
19+ raise NameError ("Module name have space." )
20+ elif ModuleName == 'Magisk-Module-Template' :
21+ raise NotImplementedError ()
2022
2123def makeTree (source = '.' ):
2224 tree = []
@@ -61,8 +63,13 @@ def makeTree(source = '.'):
6163 fData = fData .replace ('@(ModuleAuthorName)' , ModuleAuthorName )
6264 hasModified = True
6365
64- # Do modifications
6566 if hasModified :
66- with open (f , 'w' ) as file :
67- file .write (fData )
68-
67+ # Do modifications
68+ if not dryRun :
69+ with open (f , 'w' ) as file :
70+ file .write (fData )
71+ # Write modifications to console
72+ else :
73+ print ('Modified file: ' + f )
74+ print (fData )
75+ print ()
You can’t perform that action at this time.
0 commit comments