Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
game-cli
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
game-cli
Commits
34253ff3
Commit
34253ff3
authored
Jan 23, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改上传
parent
575723b0
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1173 additions
and
3 deletions
+1173
-3
cli.js
bin/cli.js
+1
-1
game-cli-upload.js
bin/game-cli-upload.js
+4
-1
index.js
bin/json-server/index.js
+4
-1
package-lock.json
package-lock.json
+1164
-0
No files found.
bin/cli.js
View file @
34253ff3
...
...
@@ -3,7 +3,7 @@
const
program
=
require
(
'commander'
);
program
.
version
(
'1.0.
1
'
)
.
version
(
'1.0.
2
'
)
.
description
(
'game command line interface'
)
.
command
(
'init [name]'
,
'Initialize a project with template'
).
alias
(
'i'
)
.
command
(
'mock'
,
'Mock server'
).
alias
(
'm'
)
...
...
bin/game-cli-upload.js
View file @
34253ff3
const
path
=
require
(
'path'
);
const
program
=
require
(
'commander'
);
const
{
exit
,
getProjectConfig
}
=
require
(
'./tools'
);
const
ossUpload
=
require
(
'./oss-upload'
);
...
...
@@ -10,11 +11,13 @@ program
async
function
execute
()
{
let
remotePath
;
let
version
=
program
.
versionCode
;
let
releasePath
=
'./bin-release/web/'
;
const
gameProjectConfig
=
getProjectConfig
();
if
(
gameProjectConfig
){
remotePath
=
gameProjectConfig
[
'remote-path'
];
version
=
version
?
version
:
gameProjectConfig
[
'version'
];
releasePath
=
gameProjectConfig
[
'release-path'
];
}
if
(
version
){
...
...
@@ -22,7 +25,7 @@ async function execute() {
if
(
remotePath
){
try
{
await
ossUpload
({
localDir
:
'./bin-release/web/'
+
version
,
localDir
:
path
.
join
(
releasePath
,
version
)
,
remoteDir
:
`/db_games/
${
remotePath
}
/
${
version
}
`
},
program
.
mode
);
}
catch
(
e
)
{
...
...
bin/json-server/index.js
View file @
34253ff3
...
...
@@ -41,7 +41,10 @@ function handler(request, response) {
const
headers
=
{
'Content-Type'
:
'application/json'
,
'Access-Control-Allow-Origin'
:
'*'
,
'Access-Control-Allow-Origin'
:
'http://localhost:3001'
,
'Access-Control-Allow-Credentials'
:
'true'
,
'Access-Control-Allow-Methods'
:
'POST,GET,PUT,OPTIONS'
,
'Access-Control-Allow-Headers'
:
'Content-Type,Access-Token'
,
};
if
(
content
)
{
...
...
package-lock.json
0 → 100644
View file @
34253ff3
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