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
29f1a5a8
Commit
29f1a5a8
authored
Apr 26, 2017
by
nano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix request
parent
1652968b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
67 deletions
+123
-67
.idea/workspace.xml
.idea/workspace.xml
+113
-59
package/main.ts
package/main.ts
+9
-7
src/routes/app.ts
src/routes/app.ts
+1
-1
No files found.
.idea/workspace.xml
View file @
29f1a5a8
This diff is collapsed.
Click to expand it.
package/main.ts
View file @
29f1a5a8
...
...
@@ -20,12 +20,14 @@ export async function bundle(...args) {
const
archive_path
=
path
.
join
(
release_path
,
'
downloads
'
,
package_id
);
const
package_path
=
path
.
join
(
app_path
,
package_id
);
const
uploadFile_path
=
path
.
join
(
upload_path
,
package_id
);
const
full_path
=
path
.
join
(
archive_path
,
'
full
'
);
const
sand_path
=
path
.
join
(
archive_path
,
'
sand
'
);
// const full_path = path.join(archive_path, 'full');
// const sand_path = path.join(archive_path, 'sand');
const
dist_path
=
path
.
join
(
archive_path
,
'
dist
'
);
await
fs
.
ensureDirAsync
(
archive_path
);
await
fs
.
ensureDirAsync
(
package_path
);
await
fs
.
ensureDirAsync
(
full_path
);
await
fs
.
ensureDirAsync
(
sand_path
);
// await fs.ensureDirAsync(full_path);
// await fs.ensureDirAsync(sand_path);
await
fs
.
ensureDirAsync
(
dist_path
);
// untar upload package
await
untar
(
uploadFile_path
,
package_path
);
...
...
@@ -45,14 +47,14 @@ export async function bundle(...args) {
size
:
(
await
fs
.
statAsync
(
file
)).
size
});
let
sand_file
=
path
.
join
(
sand
_path
,
`
${
file_hash
}
.tar.gz`
);
let
sand_file
=
path
.
join
(
dist
_path
,
`
${
file_hash
}
.tar.gz`
);
await
archiveSingle
(
sand_file
,
[
file
],
package_path
);
let
sand_hash
=
await
caculateSHA256
(
sand_file
);
archives
.
set
(
sand_file
,
{
path
:
path
.
relative
(
sand
_path
,
sand_file
),
path
:
path
.
relative
(
dist
_path
,
sand_file
),
hash
:
sand_hash
,
size
:
(
await
fs
.
statAsync
(
sand_file
)).
size
});
...
...
@@ -66,7 +68,7 @@ export async function bundle(...args) {
},
});
let
filePath
=
path
.
join
(
full
_path
,
`
${
package_id
}
.tar.gz`
);
let
filePath
=
path
.
join
(
dist
_path
,
`
${
package_id
}
.tar.gz`
);
await
fs
.
removeAsync
(
filePath
);
await
archive
(
filePath
,
await
fs
.
readdirAsync
(
package_path
),
package_path
);
...
...
src/routes/app.ts
View file @
29f1a5a8
...
...
@@ -49,7 +49,7 @@ router.patch('/v1/app/:id', async (ctx: Context, next) => {
if
(
!
app
)
{
return
ctx
.
throw
(
400
,
`App
${
ctx
.
params
.
id
}
Not Found `
);
}
if
(
ctx
.
request
.
body
.
id
||
ctx
.
request
.
body
.
id
!==
app
!
.
id
)
{
if
(
!
ctx
.
request
.
body
.
id
||
ctx
.
request
.
body
.
id
!==
app
.
id
)
{
ctx
.
throw
(
400
,
`Can not change AppID`
);
}
...
...
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