Skip to content

Commit

Permalink
修改环境检查错误
Browse files Browse the repository at this point in the history
  • Loading branch information
fuchengwei committed Nov 23, 2020
1 parent 8ac6484 commit b51f42d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions lib/commands/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const checkEnvCorrect = (config, env) => {

if (config) {
keys.forEach((key) => {
if (!config[key] || config[key] === '/') {
if (!config[env][key] || config[env][key] === '/') {
error(
`配置错误: ${underline(`${env}环境`)} ${underline(
`${key}属性`
Expand Down Expand Up @@ -272,15 +272,15 @@ module.exports = {
const currentTime = new Date().getTime()

const createdEnvConfig = (env) => {
checkEnvCorrect(config, env)

return Object.assign(config[env], {
privateKey: config.privateKey,
passphrase: config.passphrase
})
}

if (env) {
checkEnvCorrect(config, env)

const envConfig = createdEnvConfig(env)

const answers = await confirmDeploy(
Expand Down Expand Up @@ -310,8 +310,6 @@ module.exports = {

if (answers.confirm) {
for (const env of cluster) {
checkEnvCorrect(config, env)

const envConfig = createdEnvConfig(env)

createTaskList(envConfig)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deploy-cli-service",
"version": "1.2.1",
"version": "1.2.2",
"description": "前端一键自动化部署脚手架服务",
"main": "lib/service.js",
"homepage": "https://github.com/fuchengwei/deploy-cli-service",
Expand Down

0 comments on commit b51f42d

Please sign in to comment.