Added checks to make sure the specified track exists
Added precondition checks to validate input files and paths to return more informative error messages as per #2
This commit is contained in:
15
lib/edits.js
15
lib/edits.js
@@ -26,6 +26,11 @@ function uploadRelease(options, releaseFile) {
|
||||
auth: options.auth,
|
||||
packageName: options.applicationId
|
||||
});
|
||||
const allTracks = yield getAllTracks(appEdit.data, options);
|
||||
if (allTracks == undefined || allTracks.find(value => value.track == options.track) == undefined) {
|
||||
core.setFailed(`Track "${options.track}" could not be found `);
|
||||
return Promise.reject(`No track found for "${options.track}"`);
|
||||
}
|
||||
let track = undefined;
|
||||
if (releaseFile.endsWith('.apk')) {
|
||||
const apk = yield uploadApk(appEdit.data, options, releaseFile);
|
||||
@@ -51,6 +56,16 @@ function uploadRelease(options, releaseFile) {
|
||||
});
|
||||
}
|
||||
exports.uploadRelease = uploadRelease;
|
||||
function getAllTracks(appEdit, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const res = yield androidPublisher.edits.tracks.list({
|
||||
auth: options.auth,
|
||||
editId: appEdit.id,
|
||||
packageName: options.applicationId
|
||||
});
|
||||
return res.data.tracks;
|
||||
});
|
||||
}
|
||||
function trackVersionCode(appEdit, options, versionCode) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let status;
|
||||
|
||||
Reference in New Issue
Block a user