Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
srvpro
Commits
90669840
Commit
90669840
authored
Jun 25, 2018
by
Momobako
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/moecube/srvpro
parents
91565250
0f0b09bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
ygopro-update.js
ygopro-update.js
+8
-3
No files found.
ygopro-update.js
View file @
90669840
...
...
@@ -162,12 +162,16 @@ var fetchDatas = function() {
});
}
var
updateChangelogs
=
function
(
message
)
{
var
updateChangelogs
=
function
(
dir
,
message
)
{
message
=
message
.
split
(
"
!换行符!
"
).
join
(
"
\n
"
);
change_log
=
{};
change_log
.
title
=
"
服务器更新
"
;
change_log
.
date
=
moment
().
format
(
"
YYYY-MM-DD
"
);
change_log
.
text
=
message
;
var
prc_git_rev
=
spawnSync
(
"
git
"
,
[
"
rev-parse
"
,
"
HEAD
"
],
{
"
cwd
"
:
dir
});
if
(
prc_git_rev
.
stdout
)
{
change_log
.
commit
=
prc_git_rev
.
stdout
.
toString
().
split
(
/
\n
/
)[
0
];
}
changelog
.
unshift
(
change_log
);
fileContent
=
JSON
.
stringify
({
changelog
:
changelog
},
null
,
2
);
fs
.
writeFileSync
(
config
.
html_path
+
config
.
changelog_filename
,
fileContent
);
...
...
@@ -246,7 +250,8 @@ http.createServer(function (req, res) {
res
.
writeHead
(
200
);
var
date
=
moment
(
changelog
[
0
].
date
).
add
(
1
,
'
days
'
).
format
(
"
YYYY-MM-DD
"
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"开始生成
'
+
date
+
'
以来的更新记录:"});
'
);
makeChangelogs
(
config
.
script_path
,
"
--since=
"
+
date
);
var
since
=
changelog
[
0
].
commit
?
(
changelog
[
0
].
commit
+
"
..
"
)
:
(
"
--since=
"
+
date
);
makeChangelogs
(
config
.
script_path
,
since
);
}
else
if
(
u
.
pathname
===
'
/api/make_more_changelog
'
)
{
res
.
writeHead
(
200
);
...
...
@@ -256,7 +261,7 @@ http.createServer(function (req, res) {
else
if
(
u
.
pathname
===
'
/api/update_changelog
'
)
{
res
.
writeHead
(
200
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"开始写入更新记录。"});
'
);
updateChangelogs
(
u
.
query
.
message
);
updateChangelogs
(
config
.
script_path
,
u
.
query
.
message
);
}
else
if
(
u
.
pathname
===
'
/api/push_datas
'
)
{
res
.
writeHead
(
200
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment