mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 10:53:21 +02:00
Add .aab installation support (#103)
* Add .aab installation support Signed-off-by: nghia.viminh <nghia.viminh@gameloft.com>
This commit is contained in:
@@ -13,6 +13,7 @@ var logger = require('../../util/logger')
|
||||
var Storage = require('../../util/storage')
|
||||
var requtil = require('../../util/requtil')
|
||||
var download = require('../../util/download')
|
||||
var bundletool = require('../../util/bundletool')
|
||||
|
||||
module.exports = function(options) {
|
||||
var log = logger.createLogger('storage:temp')
|
||||
@@ -91,6 +92,9 @@ module.exports = function(options) {
|
||||
form.uploadDir = options.saveDir
|
||||
}
|
||||
form.on('fileBegin', function(name, file) {
|
||||
if (/\.aab$/.test(file.name)) {
|
||||
file.isAab = true
|
||||
}
|
||||
var md5 = crypto.createHash('md5')
|
||||
file.name = md5.update(file.name).digest('hex')
|
||||
})
|
||||
@@ -103,9 +107,21 @@ module.exports = function(options) {
|
||||
field: field
|
||||
, id: storage.store(file)
|
||||
, name: file.name
|
||||
, path: file.path
|
||||
, isAab: file.isAab
|
||||
}
|
||||
})
|
||||
})
|
||||
.then(function(storedFiles) {
|
||||
return Promise.all(storedFiles.map(function(file) {
|
||||
return bundletool({
|
||||
bundletoolPath: options.bundletoolPath
|
||||
, keystore: options.keystore
|
||||
, file: file
|
||||
})
|
||||
})
|
||||
)
|
||||
})
|
||||
.then(function(storedFiles) {
|
||||
res.status(201)
|
||||
.json({
|
||||
|
||||
Reference in New Issue
Block a user