diff --git a/changelog.md b/changelog.md index fd63b89..ef121b1 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,14 @@ --- +## [5.0.7] 2024-04-30 + +### Fixed + +- Remove unnecessary legacy validation, including looking for the AWS CLI during deployment; fixes #1482 + +--- + ## [5.0.6] 2024-04-29 ### Changed diff --git a/src/cli/index.js b/src/cli/index.js index 760acaa..30ae914 100755 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -2,7 +2,6 @@ let deploy = require('../../') let _inventory = require('@architect/inventory') let { banner, updater } = require('@architect/utils') -let validate = require('./validate') let _flags = require('./flags') let { version } = require('../../package.json') let pauser = require('../utils/pause-sandbox') @@ -29,9 +28,6 @@ async function main (/* opts = {} */) { // Ignore Inventory if passed, and re-Inventory with deployStage set let inventory = await _inventory({ deployStage, env: true }) - // Validate for expected env and args and check for potential creds issues - validate() - // Populate options, read args into `prune`, `verbose`, `production`, `tags`, `name`, etc. let options = { inventory, diff --git a/src/cli/validate.js b/src/cli/validate.js deleted file mode 100644 index da71e2d..0000000 --- a/src/cli/validate.js +++ /dev/null @@ -1,42 +0,0 @@ -let { updater } = require('@architect/utils') -let { delimiter, join } = require('path') -let { existsSync } = require('fs') - -let messages = { - missing_aws_cli: 'missing aws from PATH, please install the aws-cli', - missing_creds: 'missing or invalid AWS credentials or credentials file', -} - -/** - * Deploy CLI environment validator - */ -module.exports = function validate () { - try { - if (process.env.ARC_AWS_CREDS === 'missing') { - throw Error('missing_creds') - } - if (!binExists('aws')) { - throw ReferenceError('missing_aws_cli') - } - } - catch (e) { - let update = updater('Deploy') - update.error(`Failed to deploy, ${messages[e.message]}`) - process.exit(1) - } -} - -function binExists (bin) { - function getPaths (bin) { - let envPath = (process.env.PATH || '') - let envExt = (process.env.PATHEXT || '') - return envPath.replace(/["]+/g, '').split(delimiter).map(function (chunk) { - return envExt.split(delimiter).map(function (ext) { - return join(chunk, bin + ext) - }) - }).reduce(function (a, b) { - return a.concat(b) - }) - } - return getPaths(bin).some(existsSync) -}