Skip to content

Commit 7eabb4b

Browse files
authored
Force creation of GitHub Actions CI workflow (#1249)
Since we switched to using `.yml` for YAML files in #1246, generating the CI config would clash and request the user intervene. We force the template to overwrite instead. Completes #1243.
1 parent 271a110 commit 7eabb4b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/generators/suspenders/ci_generator.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class CiGenerator < Rails::Generators::Base
1212
MARKDOWN
1313

1414
def ci_files
15-
empty_directory ".github/workflows"
16-
template "ci.yml", ".github/workflows/ci.yml"
15+
template "ci.yml", ".github/workflows/ci.yml", force: true
1716
end
1817

1918
private

test/generators/suspenders/ci_generator_test.rb

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class CiGeneratorTest < Rails::Generators::TestCase
1111
teardown :restore_destination
1212

1313
test "generates CI files" do
14+
mkdir(".github/workflows")
15+
touch(".github/workflows/ci.yml")
16+
1417
with_database "postgresql" do
1518
run_generator
1619

test/test_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def remove_dir_if_exists(dir)
3535
def mkdir(dir)
3636
path = app_root dir
3737

38-
FileUtils.mkdir path
38+
FileUtils.mkdir_p path
3939
end
4040

4141
def touch(file, **options)

0 commit comments

Comments
 (0)