25 lines
451 B
JavaScript
25 lines
451 B
JavaScript
const fs = require('fs/promises');
|
|
const path = require('path');
|
|
const env = require('../../config/env');
|
|
|
|
const getAndroidApk = async () => {
|
|
const filePath = env.androidApkPath;
|
|
|
|
try {
|
|
await fs.access(filePath);
|
|
} catch {
|
|
const error = new Error('Android APK not found.');
|
|
error.statusCode = 404;
|
|
throw error;
|
|
}
|
|
|
|
return {
|
|
filePath,
|
|
fileName: path.basename(filePath),
|
|
};
|
|
};
|
|
|
|
module.exports = {
|
|
getAndroidApk,
|
|
};
|