Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
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
MyCard
console
Commits
d8b7b157
Commit
d8b7b157
authored
Apr 28, 2017
by
nano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
1d3da742
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
68 deletions
+126
-68
.idea/workspace.xml
.idea/workspace.xml
+116
-50
config.ts
config.ts
+1
-1
migrate.ts
migrate.ts
+8
-4
package/main.ts
package/main.ts
+1
-1
src/routes/upload.ts
src/routes/upload.ts
+0
-1
views/update.hbs
views/update.hbs
+0
-11
No files found.
.idea/workspace.xml
View file @
d8b7b157
This diff is collapsed.
Click to expand it.
config.ts
View file @
d8b7b157
...
...
@@ -7,7 +7,7 @@ export default {
upload_path
:
path
.
join
(
__dirname
,
'
./test/upload
'
),
download_path
:
path
.
join
(
__dirname
,
'
./test/release/downloads
'
),
new_apps_json
:
`
${
baseUrl
}
/v2/apps`
,
upload_url
:
`
${
test
Url
}
/v1/upload/packageUrl`
,
upload_url
:
`
${
base
Url
}
/v1/upload/packageUrl`
,
old_apps_json
:
'
https://api.moecube.com/apps.json
'
,
new_package
:
`
${
baseUrl
}
/v1/package/`
,
new_app
:
(
appId
)
=>
`
${
baseUrl
}
/v1/app/
${
appId
}
`
,
...
...
migrate.ts
View file @
d8b7b157
...
...
@@ -103,17 +103,21 @@ async function updateApp(app) {
async
function
main
()
{
let
{
data
}
=
await
axios
.
get
(
config
.
old_apps_json
);
let
newApps
=
await
axios
.
get
(
config
.
new_apps_json
);
newApps
.
data
.
map
(
app
=>
{
apps
[
app
[
'
id
'
]]
=
app
;
})
try
{
for
(
let
app
of
data
)
{
if
(
!
[
'
ygopro
'
,
'
desmume
'
,
'
test
'
].
includes
(
app
[
'
id
'
]))
{
apps
[
app
[
'
id
'
]]
=
app
;
if
(
!
[
'
ygopro
'
,
'
desmume
'
,
'
test
'
].
includes
(
app
[
'
id
'
])
&&
!
apps
[
app
[
'
id
'
]])
{
await
createApp
(
app
)
}
}
for
(
let
app
of
_
.
sampleSize
(
data
,
2
))
{
if
(
!
[
'
ygopro
'
,
'
desmume
'
,
'
test
'
].
includes
(
app
[
'
id
'
]))
{
for
(
let
app
of
_
.
sampleSize
(
data
,
1
))
{
if
([
'
ygopro
'
,
'
desmume
'
,
'
test
'
].
includes
(
app
[
'
id
'
]))
{
await
updateApp
(
app
);
}
}
...
...
package/main.ts
View file @
d8b7b157
...
...
@@ -70,7 +70,6 @@ export async function bundle(...args) {
let
filePath
=
path
.
join
(
dist_path
,
`
${
package_id
}
.tar.gz`
);
await
fs
.
removeAsync
(
filePath
);
await
archive
(
filePath
,
await
fs
.
readdirAsync
(
package_path
),
package_path
);
const
fullHash
=
await
caculateSHA256
(
filePath
);
...
...
@@ -79,6 +78,7 @@ export async function bundle(...args) {
let
fullPath
=
path
.
join
(
path
.
dirname
(
filePath
),
`
${
fullHash
}
.tar.gz`
);
await
fs
.
renameAsync
(
filePath
,
fullPath
);
await
fs
.
removeAsync
(
filePath
);
await
fs
.
removeAsync
(
uploadFile_path
)
await
fs
.
removeAsync
(
package_path
)
...
...
src/routes/upload.ts
View file @
d8b7b157
...
...
@@ -183,7 +183,6 @@ const uploadPackageUrl = async (ctx: Context) => {
// 上传完,干掉本地目录
await
fs
.
removeAsync
(
bundled
.
distPath
);
}
catch
(
e
)
{
console
.
log
(
e
);
pack
!
.
status
=
'
failed
'
;
...
...
views/update.hbs
deleted
100644 → 0
View file @
1d3da742
<?xml version="1.0" encoding="UTF-8"?>
<metalink
xmlns=
"urn:ietf:params:xml:ns:metalink"
>
{{#
files
}}
<file
name=
"
{{
name
}}
"
>
<size>
{{
size
}}
</size>
<hash
type=
"sha-256"
>
{{
hash
}}
</hash>
<url
priority=
"1"
>
https://cdn01.moecube.com/test-release/
{{
hash
}}
.tar.gz
</url>
<url
priority=
"1"
>
https://cdn01.moecube.com/test-release/
{{
hash
}}
.tar.gz
</url>
</file>
{{/
files
}}
</metalink>
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