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
f1501a69
Commit
f1501a69
authored
Nov 12, 2017
by
Momobako
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updatedash
parent
1ed4b0ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
dash.js
dash.js
+70
-0
No files found.
dash.js
View file @
f1501a69
...
@@ -48,6 +48,9 @@ var GitPull = function(msg) {
...
@@ -48,6 +48,9 @@ var GitPull = function(msg) {
if
(
config
.
ocg_git_db_path
)
{
if
(
config
.
ocg_git_db_path
)
{
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
"
master
"
],
config
.
ocg_git_db_path
,
"
Finished updating OCG data
"
);
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
"
master
"
],
config
.
ocg_git_db_path
,
"
Finished updating OCG data
"
);
}
}
if
(
config
.
client_git_db_path
)
{
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
config
.
client_branch
],
config
.
client_git_db_path
,
"
Finished updating client data
"
);
}
}
}
var
copyToYGOPRO
=
function
(
msg
)
{
var
copyToYGOPRO
=
function
(
msg
)
{
execSync
(
'
rm -rf
'
+
config
.
ygopro_path
+
'
expansions/*
'
+
''
);
execSync
(
'
rm -rf
'
+
config
.
ygopro_path
+
'
expansions/*
'
+
''
);
...
@@ -88,6 +91,48 @@ var MakePro = function(msg) {
...
@@ -88,6 +91,48 @@ var MakePro = function(msg) {
var
UpdateOCGScripts
=
function
(
msg
)
{
var
UpdateOCGScripts
=
function
(
msg
)
{
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
"
master
"
],
config
.
ygopro_path
+
"
script/
"
,
"
Finished updating OCG scripts
"
);
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
"
master
"
],
config
.
ygopro_path
+
"
script/
"
,
"
Finished updating OCG scripts
"
);
}
}
var
ResetOCGScripts
=
function
(
msg
)
{
runcmd
(
"
git
"
,
[
"
fetch
"
,
"
origin
"
,
"
master
"
],
config
.
ygopro_path
+
"
script/
"
,
"
Finished fetching OCG scripts
"
,
function
(
code
)
{
runcmd
(
"
git
"
,
[
"
reset
"
,
"
--hard
"
,
"
FETCH_HEAD
"
],
config
.
ygopro_path
+
"
script/
"
,
"
Finished resetting OCG scripts
"
);
});
}
var
UpdateExtraScripts
=
function
(
msg
)
{
if
(
!
config
.
extra_script_repo
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
runcmd
(
"
git
"
,
[
"
pull
"
,
config
.
extra_script_repo
,
"
master
"
],
config
.
ygopro_path
+
"
script/
"
,
"
Finished updating Extra scripts
"
);
}
var
PushExtraScripts
=
function
(
msg
)
{
if
(
!
config
.
push_script_repo
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
execSync
(
'
git push
'
+
config
.
push_script_repo
+
'
master
'
,
{
cwd
:
config
.
ygopro_path
+
"
script/
"
,
env
:
process
.
env
});
sendResponse
(
"
Finished pushing extra scripts
"
);
}
var
UpdateFilelist
=
function
(
msg
)
{
if
(
!
config
.
client_git_db_path
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
runcmd
(
"
mono
"
,
[
"
update.exe
"
,
"
-m
"
],
config
.
client_git_db_path
+
"
update/
"
,
"
Finished updating filelist
"
,
function
(
code
)
{
if
(
config
.
client_branch
&&
config
.
client_push_repo
)
{
execSync
(
'
git add . -A
'
,
{
cwd
:
config
.
client_git_db_path
,
env
:
process
.
env
});
execSync
(
'
git commit -m Filelist
'
,
{
cwd
:
config
.
client_git_db_path
,
env
:
process
.
env
});
execSync
(
'
git push
'
+
config
.
client_push_repo
+
'
'
+
config
.
client_branch
,
{
cwd
:
config
.
client_git_db_path
,
env
:
process
.
env
});
sendResponse
(
"
Finished pushing File List
"
);
}
});
}
var
ZipData
=
function
(
msg
)
{
if
(
!
config
.
client_git_db_path
||
!
config
.
zip_path
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
execSync
(
'
rm -rf
'
+
config
.
zip_path
);
runcmd
(
"
7z
"
,
[
"
a
"
,
"
-mx9
"
,
"
-xr!.git*
"
,
config
.
zip_path
,
"
./*
"
],
config
.
client_git_db_path
,
"
Finish zipping data
"
);
}
var
StartServer
=
function
(
msg
)
{
var
StartServer
=
function
(
msg
)
{
if
(
config
.
pm2_name
)
{
if
(
config
.
pm2_name
)
{
runcmd
(
"
pm2
"
,
[
"
restart
"
,
config
.
pm2_name
],
"
.
"
,
"
Server Started
"
);
runcmd
(
"
pm2
"
,
[
"
restart
"
,
config
.
pm2_name
],
"
.
"
,
"
Server Started
"
);
...
@@ -164,6 +209,31 @@ http.createServer(function (req, res) {
...
@@ -164,6 +209,31 @@ http.createServer(function (req, res) {
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Updating OCG scripts"});
'
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Updating OCG scripts"});
'
);
UpdateOCGScripts
(
u
.
query
.
message
);
UpdateOCGScripts
(
u
.
query
.
message
);
}
}
else
if
(
u
.
pathname
===
'
/api/reset_scripts
'
)
{
res
.
writeHead
(
200
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Resetting OCG scripts"});
'
);
ResetOCGScripts
(
u
.
query
.
message
);
}
else
if
(
u
.
pathname
===
'
/api/update_extra_scripts
'
)
{
res
.
writeHead
(
200
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Updating extra scripts"});
'
);
UpdateExtraScripts
(
u
.
query
.
message
);
}
else
if
(
u
.
pathname
===
'
/api/push_extra_scripts
'
)
{
res
.
writeHead
(
200
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Pushing extra scripts"});
'
);
PushExtraScripts
(
u
.
query
.
message
);
}
else
if
(
u
.
pathname
===
'
/api/zip_data
'
)
{
res
.
writeHead
(
200
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Started zipping data"});
'
);
ZipData
(
u
.
query
.
message
);
}
else
if
(
u
.
pathname
===
'
/api/update_filelist
'
)
{
res
.
writeHead
(
200
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Started updating File List"});
'
);
UpdateFilelist
(
u
.
query
.
message
);
}
else
if
(
u
.
pathname
===
'
/api/start_server
'
)
{
else
if
(
u
.
pathname
===
'
/api/start_server
'
)
{
res
.
writeHead
(
200
);
res
.
writeHead
(
200
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Starting server"});
'
);
res
.
end
(
u
.
query
.
callback
+
'
({"message":"Starting server"});
'
);
...
...
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