@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.
- package/dist/cli.js +6 -3
- 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
|
|
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`,
|
|
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) => {
|