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
b2c1b370
Commit
b2c1b370
authored
May 02, 2017
by
nano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete
parent
34a9559e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
64 deletions
+114
-64
.idea/workspace.xml
.idea/workspace.xml
+108
-61
config.ts
config.ts
+1
-1
package/main.ts
package/main.ts
+1
-0
src/routes/upload.ts
src/routes/upload.ts
+4
-2
No files found.
.idea/workspace.xml
View file @
b2c1b370
This diff is collapsed.
Click to expand it.
config.ts
View file @
b2c1b370
...
@@ -7,7 +7,7 @@ export default {
...
@@ -7,7 +7,7 @@ export default {
upload_path
:
path
.
join
(
__dirname
,
'
./test/upload
'
),
upload_path
:
path
.
join
(
__dirname
,
'
./test/upload
'
),
download_path
:
path
.
join
(
__dirname
,
'
./test/release/downloads
'
),
download_path
:
path
.
join
(
__dirname
,
'
./test/release/downloads
'
),
new_apps_json
:
`
${
baseUrl
}
/v2/apps`
,
new_apps_json
:
`
${
baseUrl
}
/v2/apps`
,
upload_url
:
`
${
base
Url
}
/v1/upload/packageUrl`
,
upload_url
:
`
${
test
Url
}
/v1/upload/packageUrl`
,
old_apps_json
:
'
https://api.moecube.com/apps.json
'
,
old_apps_json
:
'
https://api.moecube.com/apps.json
'
,
new_package
:
`
${
baseUrl
}
/v1/package/`
,
new_package
:
`
${
baseUrl
}
/v1/package/`
,
new_app
:
(
appId
)
=>
`
${
baseUrl
}
/v1/app/
${
appId
}
`
,
new_app
:
(
appId
)
=>
`
${
baseUrl
}
/v1/app/
${
appId
}
`
,
...
...
package/main.ts
View file @
b2c1b370
...
@@ -82,6 +82,7 @@ export async function bundle(...args) {
...
@@ -82,6 +82,7 @@ export async function bundle(...args) {
await
fs
.
removeAsync
(
package_path
);
await
fs
.
removeAsync
(
package_path
);
return
{
return
{
archivePath
:
archive_path
,
distPath
:
dist_path
,
distPath
:
dist_path
,
files
:
Array
.
from
(
files
.
values
()),
files
:
Array
.
from
(
files
.
values
()),
archives
:
Array
.
from
(
archives
.
values
()),
archives
:
Array
.
from
(
archives
.
values
()),
...
...
src/routes/upload.ts
View file @
b2c1b370
...
@@ -117,7 +117,7 @@ export const UploadPackage = async (ctx: Context) => {
...
@@ -117,7 +117,7 @@ export const UploadPackage = async (ctx: Context) => {
await
pack
!
.
save
();
await
pack
!
.
save
();
// 上传完,干掉本地目录
// 上传完,干掉本地目录
await
fs
.
removeAsync
(
bundled
.
dist
Path
);
await
fs
.
removeAsync
(
bundled
.
archive
Path
);
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -187,12 +187,13 @@ const uploadPackageUrl = async (ctx: Context) => {
...
@@ -187,12 +187,13 @@ const uploadPackageUrl = async (ctx: Context) => {
await
pack
!
.
save
();
await
pack
!
.
save
();
// 上传完,干掉本地目录
// 上传完,干掉本地目录
await
fs
.
removeAsync
(
bundled
.
dist
Path
);
await
fs
.
removeAsync
(
bundled
.
archive
Path
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
trace
(
e
);
console
.
trace
(
e
);
pack
!
.
status
=
'
failed
'
;
pack
!
.
status
=
'
failed
'
;
await
pack
!
.
save
();
await
pack
!
.
save
();
}
}
await
downloader
.
close
();
}
}
};
};
...
@@ -204,6 +205,7 @@ const uploadPackageUrl = async (ctx: Context) => {
...
@@ -204,6 +205,7 @@ const uploadPackageUrl = async (ctx: Context) => {
if
(
ctx
.
request
.
body
.
url
==
url
.
uri
)
{
if
(
ctx
.
request
.
body
.
url
==
url
.
uri
)
{
pack
!
.
status
=
'
failed
'
;
pack
!
.
status
=
'
failed
'
;
await
pack
!
.
save
();
await
pack
!
.
save
();
await
downloader
.
close
();
console
.
log
(
err
);
console
.
log
(
err
);
}
}
};
};
...
...
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