11import hashlib
22import json
3+ import subprocess
4+
35
46version = open ("gp-version/version" ,"r" ).read ().replace ("\n " ,"" )
5- hash = hashlib .sha256 (open ("phlow-artifact-windows-s3/git-phlow-" + version + "-windows-amd64.zip" ,"r" ).read ()).hexdigest ()
6-
7-
8- d = {
9- "version" : version ,
10- "license" : "mit" ,
11- "extract_dir" : "" ,
12- "url" : "https://github.com/Praqma/git-phlow/releases/download/v" + version + "/git-phlow-" + version + "-windows-amd64.zip" ,
13- "depends" : "git" ,
14- "homepage" : "https://github.com/praqma/git-phlow" ,
15- "hash" : hash ,
16- "bin" : "git-phlow.exe" ,
17- "notes" : "type 'git phlow' for help" ,
18- "autoupdate" : {
19- "url" : "https://github.com/Praqma/git-phlow/releases/download/v" + version + "/git-phlow-" + version + "-windows-amd64.zip"
7+
8+ def clone ():
9+ output = subprocess .check_output (["git" ,"clone" ,"scoop-bucket" ,"scoop-bucket-modified" ])
10+
11+ def scoop_release ():
12+ hash = hashlib .sha256 (open ("phlow-artifact-windows-s3/git-phlow-" + version + "-windows-amd64.zip" ,"r" ).read ()).hexdigest ()
13+ d = {
14+ "version" : version ,
15+ "license" : "mit" ,
16+ "extract_dir" : "" ,
17+ "url" : "https://github.com/Praqma/git-phlow/releases/download/v" + version + "/git-phlow-" + version + "-windows-amd64.zip" ,
18+ "depends" : "git" ,
19+ "homepage" : "https://github.com/praqma/git-phlow" ,
20+ "hash" : hash ,
21+ "bin" : "git-phlow.exe" ,
22+ "notes" : "type 'git phlow' for help" ,
23+ "autoupdate" : {
24+ "url" : "https://github.com/Praqma/git-phlow/releases/download/v" + version + "/git-phlow-" + version + "-windows-amd64.zip"
25+ }
2026 }
21- }
2227
28+ file = open ("scoop-bucket-modified/git-phlow.json" ,"w" )
29+ file .write (json .dumps (d , indent = 2 ))
30+
31+
32+ def commit ():
33+ scm = "git"
34+ folder = "scoop-bucket-modified"
35+ output = subprocess .
check_output ([
scm ,
"config" ,
"--global" ,
"user.email" ,
"[email protected] " ])
36+ print output
37+ output = subprocess .check_output ([scm ,"config" ,"--global" ,"user.name" ,"concourse" ])
38+ print output
39+
40+ output = subprocess .check_output ([scm ,"-C" ,folder ,"add" ,"--all" ])
41+ print output
42+ output = subprocess .check_output ([scm ,"-C" ,folder ,"status" ])
43+ print output
44+ output = subprocess .check_output ([scm ,"-C" ,folder ,"commit" ,"-m" ,"released " + version ])
45+ print output
2346
24- file = open ("scoop-bucket/git-phlow.json" ,"w" )
25- file .write (json .dumps (d , indent = 2 ))
47+ clone ()
48+ scoop_release ()
49+ commit ()
50+
0 commit comments