@atomicsmash/init-testing 1.0.0-beta.5 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +6 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -140,13 +140,16 @@ await Promise.all([
140
140
  linesToAddToGitignore.push(line);
141
141
  }
142
142
  }
143
- return linesToAddToGitignore;
143
+ return {
144
+ linesToAddToGitignore,
145
+ fileEndsWithEmptyLine: fileLines.at(-1) === "",
146
+ };
144
147
  })
145
- .then(async (linesToAddToGitignore) => {
148
+ .then(async ({ linesToAddToGitignore, fileEndsWithEmptyLine }) => {
146
149
  if (linesToAddToGitignore.length === 0) {
147
150
  return false;
148
151
  }
149
- await appendFile(`${process.cwd()}/.gitignore`, `\n\n# Testing tools\n${linesToAddToGitignore.join(`\n`)}\n`);
152
+ await appendFile(`${process.cwd()}/.gitignore`, `${fileEndsWithEmptyLine ? "\n" : "\n\n"}# Testing tools\n${linesToAddToGitignore.join(`\n`)}\n`);
150
153
  return true;
151
154
  })
152
155
  .then((wasFileUpdated) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atomicsmash/init-testing",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.5",
4
+ "version": "1.0.0",
5
5
  "description": "Allow us to easily add automated testing setup to any npm setup.",
6
6
  "keywords": [
7
7
  "atomic",