| 65 | } |
| 66 | |
| 67 | async function api(debug, watch) { |
| 68 | log.ok('API'); |
| 69 | try { |
| 70 | const tasks = [bundleAPI]; |
| 71 | if (!debug) { |
| 72 | tasks.push(codeStyle); |
| 73 | } |
| 74 | await runTasks(tasks, {platforms: {[PLATFORM.API]: true}, debug, watch, version: false, log: false, test: false}); |
| 75 | if (watch) { |
| 76 | bundleAPI.watch(); |
| 77 | log.ok('Watching...'); |
| 78 | } |
| 79 | log.ok('MISSION PASSED! RESPECT +'); |
| 80 | } catch (err) { |
| 81 | console.log(err); |
| 82 | log.error(`MISSION FAILED!`); |
| 83 | process.exit(13); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | async function run({release, debug, platforms, watch, log, test, version}) { |
| 88 | const regular = Object.keys(platforms).some((platform) => platform !== PLATFORM.API && platforms[platform]); |