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
5a86e6ed
Commit
5a86e6ed
authored
Nov 14, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash
parent
50c336da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
20 deletions
+80
-20
dash.js
dash.js
+80
-20
No files found.
dash.js
View file @
5a86e6ed
...
...
@@ -44,31 +44,49 @@ var runcmd = function(cmd, args, path, endmsg, op) {
}
var
GitPull
=
function
(
msg
)
{
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
"
master
"
],
config
.
git_db_path
,
"
Finished updating data
"
);
if
(
config
.
git_db_path
)
{
var
branch
=
config
.
server_branch
;
if
(
!
branch
)
{
branch
=
"
master
"
;
}
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
branch
],
config
.
git_db_path
,
"
Finished updating data
"
);
}
if
(
config
.
ocg_git_db_path
)
{
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
"
master
"
],
config
.
ocg_git_db_path
,
"
Finished updating OCG data
"
);
var
branch
=
config
.
ocg_branch
;
if
(
!
branch
)
{
branch
=
"
master
"
;
}
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
branch
],
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
branch
=
config
.
client_branch
;
if
(
!
branch
)
{
branch
=
"
master
"
;
}
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
branch
],
config
.
client_git_db_path
,
"
Finished updating client data
"
);
}
}
var
copyToYGOPRO
=
function
(
msg
)
{
if
(
!
config
.
ygopro_path
||
!
config
.
git_db_path
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
execSync
(
'
rm -rf
'
+
config
.
ygopro_path
+
'
expansions/*
'
+
''
);
execSync
(
'
cp -rf "
'
+
config
.
db_path
+
'
expansions
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
db_path
+
'
gframe
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
db_path
+
'
ocgcore
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
db_path
+
'
lflist.conf
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
git_
db_path
+
'
expansions
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
git_
db_path
+
'
gframe
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
git_
db_path
+
'
ocgcore
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
git_
db_path
+
'
lflist.conf
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
sendResponse
(
"
Finished copying to YGOPro
"
);
if
(
config
.
ocg_db_path
)
{
execSync
(
'
cp -rf "
'
+
config
.
ocg_db_path
+
'
expansions
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
ocg_db_path
+
'
cards.cdb
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
if
(
config
.
ocg_
git_
db_path
)
{
execSync
(
'
cp -rf "
'
+
config
.
ocg_
git_
db_path
+
'
expansions
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
ocg_
git_
db_path
+
'
cards.cdb
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
sendResponse
(
"
Finished copying OCG data to YGOPro
"
);
}
else
{
execSync
(
'
cp -rf "
'
+
config
.
db_path
+
'
cards.cdb
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
execSync
(
'
cp -rf "
'
+
config
.
git_
db_path
+
'
cards.cdb
'
+
'
" "
'
+
config
.
ygopro_path
+
'
"
'
);
}
}
var
MakePro
=
function
(
msg
)
{
if
(
config
.
enable_compile
)
{
if
(
config
.
ygopro_path
&&
config
.
enable_compile
)
{
execSync
(
'
mkdir ygopro-temp
'
,
{
cwd
:
config
.
ygopro_path
,
env
:
process
.
env
});
execSync
(
'
cp -rf ocgcore ygopro-temp
'
,
{
cwd
:
config
.
ygopro_path
,
env
:
process
.
env
});
execSync
(
'
cp -rf gframe ygopro-temp
'
,
{
cwd
:
config
.
ygopro_path
,
env
:
process
.
env
});
...
...
@@ -89,14 +107,26 @@ var MakePro = function(msg) {
}
}
var
UpdateOCGScripts
=
function
(
msg
)
{
if
(
!
config
.
ygopro_path
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
"
master
"
],
config
.
ygopro_path
+
"
script/
"
,
"
Finished updating OCG scripts
"
);
}
var
ResetOCGScripts
=
function
(
msg
)
{
if
(
!
config
.
ygopro_path
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
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
.
ygopro_path
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
if
(
!
config
.
extra_script_repo
)
{
sendResponse
(
"
Permission denied
"
);
return
;
...
...
@@ -104,25 +134,55 @@ var UpdateExtraScripts = function(msg) {
runcmd
(
"
git
"
,
[
"
pull
"
,
config
.
extra_script_repo
,
"
master
"
],
config
.
ygopro_path
+
"
script/
"
,
"
Finished updating Extra scripts
"
);
}
var
PushExtraScripts
=
function
(
msg
)
{
if
(
!
config
.
ygopro_path
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
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
});
try
{
execSync
(
'
git push
'
+
config
.
push_script_repo
+
'
master
'
,
{
cwd
:
config
.
ygopro_path
+
"
script/
"
,
env
:
process
.
env
});
}
catch
(
error
)
{
sendResponse
(
"
git error:
"
+
error
.
stdout
);
sendResponse
(
"
Failed pushing extra scripts
"
);
return
;
}
sendResponse
(
"
Finished pushing extra scripts
"
);
}
var
UpdateFilelist
=
function
(
msg
)
{
if
(
!
config
.
client_git_db_path
||
!
config
.
client_push_repo
)
{
if
(
!
config
.
client_git_db_path
)
{
sendResponse
(
"
Permission denied
"
);
return
;
}
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
config
.
client_branch
],
config
.
client_git_db_path
,
"
Finished updating File List
"
,
function
(
code
)
{
execSync
(
'
mono update.exe -m
'
,
{
cwd
:
config
.
client_git_db_path
+
"
update/
"
,
env
:
process
.
env
});
var
branch
=
config
.
client_branch
;
if
(
!
branch
)
{
branch
=
"
master
"
;
}
runcmd
(
"
git
"
,
[
"
pull
"
,
"
origin
"
,
branch
],
config
.
client_git_db_path
,
"
Finished updating File List
"
,
function
(
code
)
{
try
{
execSync
(
'
mono update.exe -m
'
,
{
cwd
:
config
.
client_git_db_path
+
"
update/
"
,
env
:
process
.
env
});
}
catch
(
error
)
{
try
{
execSync
(
'
update.exe -m
'
,
{
cwd
:
config
.
client_git_db_path
+
"
update/
"
,
env
:
process
.
env
});
}
catch
(
error
)
{
sendResponse
(
error
);
sendResponse
(
"
Failed generating File List
"
);
return
;
}
}
sendResponse
(
"
Finished generating File List
"
);
if
(
config
.
client_branch
)
{
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
});
if
(
config
.
client_push_repo
)
{
try
{
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
+
'
'
+
branch
,
{
cwd
:
config
.
client_git_db_path
,
env
:
process
.
env
});
}
catch
(
error
)
{
sendResponse
(
"
git error:
"
+
error
.
stdout
);
sendResponse
(
"
Failed pushing File List
"
);
return
;
}
sendResponse
(
"
Finished pushing File List
"
);
}
});
...
...
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