Skip to content

Commit 164a56f

Browse files
fix(setup-test): remove shell true (#367)
<!-- 👋 Hi, thanks for sending a PR to template-typescript-node-package! 💖. Please fill out all fields below and make sure each item is true and [x] checked. Otherwise we may not be able to review your PR. --> ## PR Checklist - [x] Addresses an existing open issue: fixes #357 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md) were taken ## Overview <!-- Description of what is changed and how the code change does that. --> Added [`globby`](https://github.com/sindresorhus/globby) package. Reason - sindresorhus/execa#555 (comment) --------- Co-authored-by: Josh Goldberg ✨ <[email protected]>
1 parent f079f98 commit 164a56f

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

knip.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://unpkg.com/knip@next/schema.json",
33
"entry": ["src/index.ts!", "script/setup*.js"],
4-
"ignoreBinaries": ["gh"],
4+
"ignoreBinaries": ["gh", "grep"],
55
"project": ["src/**/*.ts!", "script/**/*.js"]
66
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"eslint-plugin-vitest": "^0.0.57",
5959
"eslint-plugin-yml": "^1.5.0",
6060
"execa": "^7.1.1",
61+
"globby": "^13.1.3",
6162
"husky": "^8.0.3",
6263
"jsonc-eslint-parser": "^2.1.0",
6364
"knip": "2.8.2",

pnpm-lock.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

script/setup-test-e2e.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { strict as assert } from "node:assert";
22

33
import { $ } from "execa";
44
import { promises as fs } from "fs";
5+
import { globby } from "globby";
56

67
const description = "New Description Test";
78
const owner = "NewOwnerTest";
@@ -20,15 +21,16 @@ console.log("New package JSON:", newPackageJson);
2021
assert.equal(newPackageJson.description, description);
2122
assert.equal(newPackageJson.name, repository);
2223

24+
const files = await globby(["*.*", "**/*.*"], {
25+
gitignore: true,
26+
ignoreFiles: ["script/setup.js", "script/setup-test-e2e.js"],
27+
});
28+
2329
for (const search of [
2430
`/JoshuaKGoldberg/`,
2531
"template-typescript-node-package",
2632
]) {
27-
const { stdout } = await $({
28-
// Todo: it'd be nice to not have to use this... but we haven't figured out how yet.
29-
// https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues/357
30-
shell: true,
31-
})`grep --exclude script/setup.js --exclude script/setup-test-e2e.js --exclude-dir node_modules -i ${search} *.* **/*.*`;
33+
const { stdout } = await $`grep -i ${search} ${files}`;
3234
assert.equal(
3335
stdout,
3436
`README.md:> 💙 This package is based on [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg)'s [template-typescript-node-package](https://github.com/JoshuaKGoldberg/template-typescript-node-package).`

script/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ try {
519519

520520
await withSpinner(
521521
async () => {
522-
await $`pnpm remove execa @clack/prompts all-contributors-cli chalk octokit npm-user replace-in-file title-case -D`;
522+
await $`pnpm remove execa globby @clack/prompts all-contributors-cli chalk octokit npm-user replace-in-file title-case -D`;
523523
},
524524
{
525525
startText: `Removing devDependency packages only used for setup...`,

0 commit comments

Comments
 (0)