From daef32b4a31689befa1fce19b3f2a695a865ef18 Mon Sep 17 00:00:00 2001 From: os1ma <39944763+os1ma@users.noreply.github.com> Date: Wed, 3 Nov 2021 01:03:16 +0900 Subject: [PATCH] Ignore setup GitHub Actions if hosting also selected (#3742) (#3838) * Ignore setup GitHub Actions if hosting also selected * Add a line to CHANGELOG.md Co-authored-by: Bryan Kendall --- CHANGELOG.md | 1 + src/commands/init.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb2d..4254acaa6cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1 @@ +- Fixes issue where `init` would crash with multiple Hosting items selected (#3742). diff --git a/src/commands/init.js b/src/commands/init.js index b15e3533bf0..b558ef38411 100644 --- a/src/commands/init.js +++ b/src/commands/init.js @@ -189,6 +189,11 @@ module.exports = new Command("init [feature]") setup.features.unshift("account"); } + // "hosting:github" is a part of "hosting", so if both are selected, "hosting:github" is ignored. + if (setup.features.includes("hosting") && setup.features.includes("hosting:github")) { + setup.features = setup.features.filter((f) => f != "hosting:github"); + } + return init(setup, config, options); }) .then(function () {