13
13
CHECKOUT_GYP_PATH = os .path .join (CHECKOUT_PATH , "gyp" )
14
14
15
15
parser = argparse .ArgumentParser ()
16
- parser .add_argument ("--no-commit" ,
17
- action = "store_true" ,
18
- dest = "no_commit" ,
19
- help = "do not run git-commit" )
16
+ parser .add_argument (
17
+ "--no-commit" , action = "store_true" , dest = "no_commit" , help = "do not run git-commit"
18
+ )
20
19
parser .add_argument ("tag" , help = "gyp tag to update to" )
21
20
args = parser .parse_args ()
22
21
37
36
38
37
print ("Unzipping..." )
39
38
with tarfile .open (tar_file , "r:gz" ) as tar_ref :
40
- def is_within_directory (directory , target ):
41
39
40
+ def is_within_directory (directory , target ):
42
41
abs_directory = os .path .abspath (directory )
43
42
abs_target = os .path .abspath (target )
44
43
@@ -47,7 +46,6 @@ def is_within_directory(directory, target):
47
46
return prefix == abs_directory
48
47
49
48
def safe_extract (tar , path = "." , members = None , * , numeric_owner = False ):
50
-
51
49
for member in tar .getmembers ():
52
50
member_path = os .path .join (path , member .name )
53
51
if not is_within_directory (path , member_path ):
@@ -65,7 +63,7 @@ def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
65
63
)
66
64
67
65
if not args .no_commit :
68
- subprocess .check_output (["git" , "add" , "gyp" ], cwd = CHECKOUT_PATH )
69
- subprocess .check_output ([
70
- "git" , "commit" , "-m" , f"feat(gyp): update gyp to { args .tag } "
71
- ] )
66
+ subprocess .check_output (["git" , "add" , "gyp" ], cwd = CHECKOUT_PATH )
67
+ subprocess .check_output (
68
+ [ "git" , "commit" , "-m" , f"feat(gyp): update gyp to { args .tag } " ]
69
+ )
0 commit comments