Skip to content

Commit f80c503

Browse files
committed
Remove paragraphs in README.md
1 parent ea4bc71 commit f80c503

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
44
[![Tests](https://github.com/:vendor_slug/:package_slug/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/:vendor_slug/:package_slug/actions/workflows/run-tests.yml)
55
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
6-
6+
<!--delete-->
77
---
88
This package can be used as to scaffold a framework agnostic package. Follow these steps to get started:
99

@@ -12,7 +12,7 @@ This package can be used as to scaffold a framework agnostic package. Follow the
1212
3. Have fun creating your package.
1313
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
1414
---
15-
15+
<!--/delete-->
1616
This is where your description should go. Try and limit it to a paragraph or two. Consider adding a small example.
1717

1818
## Support us

configure.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ function replace_in_file(string $file, array $replacements): void {
6060
);
6161
}
6262

63+
function removeReadmeParagraphs(string $file): void {
64+
$contents = file_get_contents($file);
65+
66+
file_put_contents(
67+
$file,
68+
preg_replace('/<!--delete-->.*<!--\/delete-->/s', '', $contents) ?: $contents
69+
);
70+
}
71+
72+
function determineSeparator(string $path): string {
73+
return str_replace('/', DIRECTORY_SEPARATOR, $path);
74+
}
75+
6376
function replaceForWindows(): array {
6477
return preg_split('/\\r\\n|\\r|\\n/', run('dir /S /B * | findstr /v /i .git\ | findstr /v /i vendor | findstr /v /i '.basename(__FILE__).' | findstr /r /i /M /F:/ ":author :vendor :package VendorName skeleton vendor_name vendor_slug [email protected]"'));
6578
}
@@ -68,7 +81,6 @@ function replaceForAllOtherOSes(): array {
6881
return explode(PHP_EOL, run('grep -E -r -l -i ":author|:vendor|:package|VendorName|skeleton|vendor_name|vendor_slug|[email protected]" --exclude-dir=vendor ./* ./.github/* | grep -v ' . basename(__FILE__)));
6982
}
7083

71-
7284
$gitName = run('git config user.name');
7385
$authorName = ask('Author name', $gitName);
7486

@@ -126,7 +138,8 @@ function replaceForAllOtherOSes(): array {
126138
]);
127139

128140
match (true) {
129-
str_contains($file, 'src'.DIRECTORY_SEPARATOR.'SkeletonClass.php') => rename($file, '.'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'' . $className . 'Class.php'),
141+
str_contains($file, determineSeparator('src/SkeletonClass.php')) => rename($file, determineSeparator('./src/' . $className . 'Class.php')),
142+
str_contains($file, 'README.md') => removeReadmeParagraphs($file),
130143
default => [],
131144
};
132145

0 commit comments

Comments
 (0)