contribute-now 0.4.0-dev.ba6545c → 0.4.0-dev.c791252
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 +5 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { defineCommand } from "citty";
|
|
|
10
10
|
import pc2 from "picocolors";
|
|
11
11
|
|
|
12
12
|
// src/utils/config.ts
|
|
13
|
-
import {
|
|
13
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { join } from "node:path";
|
|
15
15
|
var CONFIG_FILENAME = ".contributerc.json";
|
|
16
16
|
function getConfigPath(cwd = process.cwd()) {
|
|
@@ -86,23 +86,6 @@ function isGitignored(cwd = process.cwd()) {
|
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
function ensureGitignored(cwd = process.cwd()) {
|
|
90
|
-
if (isGitignored(cwd))
|
|
91
|
-
return false;
|
|
92
|
-
const gitignorePath = join(cwd, ".gitignore");
|
|
93
|
-
const line = `${CONFIG_FILENAME}
|
|
94
|
-
`;
|
|
95
|
-
if (!existsSync(gitignorePath)) {
|
|
96
|
-
writeFileSync(gitignorePath, line, "utf-8");
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
const content = readFileSync(gitignorePath, "utf-8");
|
|
100
|
-
const needsLeadingNewline = content.length > 0 && !content.endsWith(`
|
|
101
|
-
`);
|
|
102
|
-
appendFileSync(gitignorePath, `${needsLeadingNewline ? `
|
|
103
|
-
` : ""}${line}`, "utf-8");
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
89
|
function getDefaultConfig() {
|
|
107
90
|
return {
|
|
108
91
|
workflow: "clean-flow",
|
|
@@ -2018,7 +2001,7 @@ import pc7 from "picocolors";
|
|
|
2018
2001
|
// package.json
|
|
2019
2002
|
var package_default = {
|
|
2020
2003
|
name: "contribute-now",
|
|
2021
|
-
version: "0.4.0-dev.
|
|
2004
|
+
version: "0.4.0-dev.c791252",
|
|
2022
2005
|
description: "Git workflow CLI for squash-merge two-branch models. Keeps dev in sync with main after squash merges.",
|
|
2023
2006
|
type: "module",
|
|
2024
2007
|
bin: {
|
|
@@ -2816,8 +2799,9 @@ var setup_default = defineCommand7({
|
|
|
2816
2799
|
warn("Config was saved — verify the branch name and re-run setup if needed.");
|
|
2817
2800
|
}
|
|
2818
2801
|
}
|
|
2819
|
-
if (
|
|
2820
|
-
|
|
2802
|
+
if (!isGitignored()) {
|
|
2803
|
+
warn(".contributerc.json is not in .gitignore. Add it to avoid committing personal config.");
|
|
2804
|
+
warn(' echo ".contributerc.json" >> .gitignore');
|
|
2821
2805
|
}
|
|
2822
2806
|
console.log();
|
|
2823
2807
|
info(`Workflow: ${pc10.bold(WORKFLOW_DESCRIPTIONS[config.workflow])}`);
|
package/package.json
CHANGED