rrce-workflow 0.2.21 → 0.2.22
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/index.js +8 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -609,7 +609,7 @@ async function runSetupFlow(workspacePath, workspaceName, existingProjects) {
|
|
|
609
609
|
});
|
|
610
610
|
},
|
|
611
611
|
addToGitignore: () => confirm({
|
|
612
|
-
message: "Add generated folders to .gitignore?",
|
|
612
|
+
message: "Add generated folders to .gitignore? (as comments - uncomment if needed)",
|
|
613
613
|
initialValue: true
|
|
614
614
|
}),
|
|
615
615
|
confirm: () => confirm({
|
|
@@ -841,7 +841,11 @@ function updateGitignore(workspacePath, storageMode, tools) {
|
|
|
841
841
|
const newEntries = [];
|
|
842
842
|
for (const entry of entries) {
|
|
843
843
|
const entryWithoutSlash = entry.replace(/\/$/, "");
|
|
844
|
-
|
|
844
|
+
const commentedEntry = `# ${entry}`;
|
|
845
|
+
const commentedEntryNoSlash = `# ${entryWithoutSlash}`;
|
|
846
|
+
if (!lines.some(
|
|
847
|
+
(line) => line === entry || line === entryWithoutSlash || line === commentedEntry || line === commentedEntryNoSlash
|
|
848
|
+
)) {
|
|
845
849
|
newEntries.push(entry);
|
|
846
850
|
}
|
|
847
851
|
}
|
|
@@ -853,9 +857,9 @@ function updateGitignore(workspacePath, storageMode, tools) {
|
|
|
853
857
|
newContent += "\n";
|
|
854
858
|
}
|
|
855
859
|
if (newContent === "" || !content.includes("# rrce-workflow")) {
|
|
856
|
-
newContent += "\n# rrce-workflow generated folders\n";
|
|
860
|
+
newContent += "\n# rrce-workflow generated folders (uncomment to ignore)\n";
|
|
857
861
|
}
|
|
858
|
-
newContent += newEntries.join("\n") + "\n";
|
|
862
|
+
newContent += newEntries.map((e) => `# ${e}`).join("\n") + "\n";
|
|
859
863
|
fs7.writeFileSync(gitignorePath, newContent);
|
|
860
864
|
return true;
|
|
861
865
|
} catch {
|