-
Notifications
You must be signed in to change notification settings - Fork 1
/
pusher.cpp
48 lines (47 loc) · 1.35 KB
/
pusher.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include<bits/stdc++.h>
using namespace std;
unsigned int system(string s){
return system(s.data());
}
int main(int argc,char** argv){
ifstream fin("..\\wordle\\wordle.cpp");
string ver,tmp;
while(getline(fin,tmp)){
if(tmp.substr(0,12)=="string ver=\"") break;
}
fin.close();
for(int i=12;i<(int)(tmp.size());i++){
if(tmp[i]=='\"') break;
ver+=tmp[i];
}
system("taskkill /f /im wordle.exe");
system("cls");
system("msbuild ..\\wordle\\wordle.vcxproj -p:Configuration=Release");
system("copy ..\\wordle\\Release\\wordle.exe ..\\wordle\\wordle.exe /Y");
ifstream ain("assets.txt");
string file,uver;
map<string,string> assets;
while(ain>>file>>uver){
if(system("fc ..\\wordle\\"+file+" "+file)){
uver=ver;
system("copy ..\\wordle\\"+file+" "+file);
}
assets[file]=uver;
}
ain.close();
ofstream aout("assets.txt");
for(pair<string,string> P:assets)
aout<<P.first<<" "<<P.second<<endl;
aout.close();
system("echo "+ver+" > latest.txt");
system("copy ..\\wordle\\wordle.cpp wordle.cpp");
system("copy ..\\wordle\\wordle.exe wordle.exe");
system("commiter --no-pause");
system("gh release create "+ver+" --generate-notes");
system("gh release upload "+ver+" .\\wordle.cpp");
system("gh release upload "+ver+" .\\wordle.exe");
for(pair<string,string> P:assets)
system("gh release upload "+ver+" .\\"+P.first);
system("pause");
return 0;
}