UNPKG

@applicaster/zapplicaster-cli

Version:

CLI Tool for the zapp app and Quick Brick project

30 lines (24 loc) 723 B
// const { existsSync } = require("fs"); const semver = require("semver"); const R = require("ramda"); /** * Checks wether the workspace can be prepared * @param {any} { cliArgs, cliOptions } : CLI argument and options */ function prerequisitesChecker() { const { ZAPP_TOKEN } = process.env; // has ZAPP_TOKEN if (R.isNil(ZAPP_TOKEN)) { throw new Error( "No ZAPP_TOKEN defined - please add your ZAPP_TOKEN to your environment variables" ); } // runs node LTS if (!semver.satisfies(process.version, ">= 12.0.0")) { throw new Error( "Unsupported node version - please use any version compliant with >= 12.0.0" ); } return true; } module.exports = { prerequisitesChecker };