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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
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
MyCard
srvpro
Commits
185af253
Commit
185af253
authored
9 years ago
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pre-release cards log
parent
b1da83b2
master
athletic-check
auth
chall
cloud-replay-test-2
database
dependabot/npm_and_yarn/ws-3.3.1
dockernew
extime
github/fork/Helicosaurus/patch-1
hide_name
hook
improves
info
kick_reconnect
libevent21
mycard-deprecated
mycard-improve
neos
neos_dev
patch-mdpro3-deck
replay_delay
server-merge-1353
sharp
stand
support_version
travis
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
ygopro-pre.js
ygopro-pre.js
+11
-5
No files found.
ygopro-pre.js
View file @
185af253
...
...
@@ -13,6 +13,8 @@ var fs = require('fs');
var
execSync
=
require
(
'
child_process
'
).
execSync
;
var
spawn
=
require
(
'
child_process
'
).
spawn
;
var
url
=
require
(
'
url
'
);
var
moment
=
require
(
'
moment
'
);
moment
.
locale
(
'
zh-cn
'
);
var
constants
=
require
(
'
./constants.json
'
);
var
config
=
require
(
'
./config.pre.json
'
);
...
...
@@ -162,10 +164,14 @@ var loadDb = function(db_file) {
}
//将cardHTMLs中内容更新到指定列表页,同步
var
writeToFile
=
function
()
{
var
writeToFile
=
function
(
message
)
{
var
fileContent
=
fs
.
readFileSync
(
config
.
html_path
+
config
.
html_filename
,
{
"
encoding
"
:
"
utf-8
"
});
var
newContent
=
cardHTMLs
.
join
(
"
\r\n
"
);
fileContent
=
fileContent
.
replace
(
/<tbody class="auto-generated">
[\w\W]
*<
\/
tbody>/
,
'
<tbody class="auto-generated">
\r\n
'
+
newContent
+
'
\r\n
</tbody>
'
);
if
(
message
)
{
message
=
"
<li>
"
+
moment
().
format
(
'
L HH:mm
'
)
+
"
<ul><li>
"
+
message
.
split
(
"
!换行符!
"
).
join
(
"
</li><li>
"
)
+
"
</li></ul></li>
"
;
fileContent
=
fileContent
.
replace
(
/<ul class="auto-generated">/
,
'
<ul class="auto-generated">
\r\n
'
+
message
);
}
fs
.
writeFileSync
(
config
.
html_path
+
config
.
html_filename
,
fileContent
);
sendResponse
(
"
列表更新完成。
"
);
copyImages
();
...
...
@@ -253,7 +259,7 @@ var packDatas = function() {
var
proc
=
spawn
(
"
7za
"
,
[
"
a
"
,
"
-x!*.zip
"
,
"
-x!mobile.cdb
"
,
"
ygosrv233-pre.zip
"
,
"
*
"
],
{
cwd
:
config
.
db_path
,
env
:
process
.
env
});
proc
.
stdout
.
setEncoding
(
'
utf8
'
);
proc
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
sendResponse
(
"
7z:
"
+
data
);
//
sendResponse("7z: "+data);
});
proc
.
stderr
.
setEncoding
(
'
utf8
'
);
proc
.
stderr
.
on
(
'
data
'
,
function
(
data
)
{
...
...
@@ -263,10 +269,10 @@ var packDatas = function() {
execSync
(
'
mv -f "
'
+
config
.
db_path
+
'
ygosrv233-pre.zip" "
'
+
config
.
html_path
+
'
"
'
);
sendResponse
(
"
电脑更新包打包完成。
"
);
});
var
proc2
=
spawn
(
"
7za
"
,
[
"
a
"
,
"
-x!*.zip
"
,
"
-x!expansions
"
,
"
ygosrv233-pre-mobile.zip
"
,
"
*
"
],
{
cwd
:
config
.
db_path
,
env
:
process
.
env
});
var
proc2
=
spawn
(
"
7za
"
,
[
"
a
"
,
"
-x!*.zip
"
,
"
-x!expansions
"
,
"
-x!pics/thumbnail
"
,
"
ygosrv233-pre-mobile.zip
"
,
"
*
"
],
{
cwd
:
config
.
db_path
,
env
:
process
.
env
});
proc2
.
stdout
.
setEncoding
(
'
utf8
'
);
proc2
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
sendResponse
(
"
7z:
"
+
data
);
//
sendResponse("7z: "+data);
});
proc2
.
stderr
.
setEncoding
(
'
utf8
'
);
proc2
.
stderr
.
on
(
'
data
'
,
function
(
data
)
{
...
...
@@ -322,7 +328,7 @@ http.createServer(function (req, res) {
else
if
(
u
.
pathname
===
'
/api/write_to_file
'
)
{
res
.
writeHead
(
200
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"开始写列表页。"});
'
);
writeToFile
();
writeToFile
(
u
.
query
.
message
);
}
else
if
(
u
.
pathname
===
'
/api/copy_to_ygopro
'
)
{
res
.
writeHead
(
200
);
...
...
This diff is collapsed.
Click to expand it.
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