autogit-tool 1.0.29 → 1.0.30
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/README.md
CHANGED
|
@@ -27,7 +27,7 @@ When you run `autogit` inside a project directory it:
|
|
|
27
27
|
7. Generates a LinkedIn post, X (Twitter) post, DEV.to draft, and resume bullet
|
|
28
28
|
8. Saves a share package with a sourced LinkedIn post, text drafts, evidence, and three PNG cards; offers a Brag video when its optional setup is installed
|
|
29
29
|
|
|
30
|
-
The share package is saved under `~/.autogit/social/<project>/`. LinkedIn publishing and image upload still require your review. Destructive or public-facing Git actions require confirmation; pass `--yes` to skip prompts.
|
|
30
|
+
The share package is saved under `~/.autogit/social/<project>/`. LinkedIn publishing and image upload still require your review. Destructive or public-facing Git actions require confirmation; pass `--yes` to skip prompts. AutoGit can be run from a wrapper containing one project, but refuses to treat your user home directory as a project.
|
|
31
31
|
|
|
32
32
|
The main run creates three evidence cards automatically, including for CLI, API, and library projects. A real screenshot is optional and only applies when a web app is currently reachable at an HTTP(S) URL; leave the URL blank to skip it. Conceptual artwork is available with `autogit --promo-image` when an image provider is configured.
|
|
33
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-root.d.ts","sourceRoot":"","sources":["../../src/utils/project-root.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-root.d.ts","sourceRoot":"","sources":["../../src/utils/project-root.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,uBAAuB,CAAC,cAAc,SAAgB,GAAG,gBAAgB,CAYxF"}
|
|
@@ -1,30 +1,43 @@
|
|
|
1
|
-
import { existsSync, readdirSync
|
|
1
|
+
import { existsSync, readdirSync } from 'fs';
|
|
2
2
|
import { join, resolve } from 'path';
|
|
3
|
+
import { homedir } from 'os';
|
|
3
4
|
const PROJECT_MARKERS = [
|
|
4
5
|
'package.json', 'pyproject.toml', 'requirements.txt', 'Cargo.toml', 'go.mod',
|
|
5
6
|
'pom.xml', 'build.gradle', 'build.gradle.kts', 'composer.json', 'Gemfile',
|
|
7
|
+
'CMakeLists.txt', 'Makefile', 'pubspec.yaml', 'mix.exs', 'deno.json', 'index.html',
|
|
6
8
|
];
|
|
7
9
|
function hasProjectMarker(directory) {
|
|
8
|
-
|
|
10
|
+
if (PROJECT_MARKERS.some(marker => existsSync(join(directory, marker))))
|
|
11
|
+
return true;
|
|
12
|
+
try {
|
|
13
|
+
return readdirSync(directory).some(name => /\.(sln|csproj|fsproj|vbproj)$/i.test(name));
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function findProjects(directory, depth) {
|
|
20
|
+
if (hasProjectMarker(directory))
|
|
21
|
+
return [directory];
|
|
22
|
+
if (depth === 0)
|
|
23
|
+
return [];
|
|
24
|
+
try {
|
|
25
|
+
return readdirSync(directory, { withFileTypes: true })
|
|
26
|
+
.filter(entry => entry.isDirectory() && !entry.name.startsWith('.') && !['node_modules', 'vendor', 'dist', 'build'].includes(entry.name))
|
|
27
|
+
.flatMap(entry => findProjects(join(directory, entry.name), depth - 1));
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
9
32
|
}
|
|
10
33
|
export function resolveProjectDirectory(startDirectory = process.cwd()) {
|
|
11
34
|
const start = resolve(startDirectory);
|
|
35
|
+
if (start.toLowerCase() === resolve(homedir()).toLowerCase()) {
|
|
36
|
+
throw new Error('Refusing to use your home directory as a project. Run autogit from the project folder or a wrapper containing one project.');
|
|
37
|
+
}
|
|
12
38
|
if (hasProjectMarker(start))
|
|
13
39
|
return { root: start, discovered: false };
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
children = readdirSync(start)
|
|
17
|
-
.map(name => join(start, name))
|
|
18
|
-
.filter(path => {
|
|
19
|
-
try {
|
|
20
|
-
return statSync(path).isDirectory() && hasProjectMarker(path);
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
catch { /* keep the requested directory */ }
|
|
40
|
+
const children = findProjects(start, 3).filter(path => path !== start);
|
|
28
41
|
return children.length === 1
|
|
29
42
|
? { root: children[0], discovered: true }
|
|
30
43
|
: { root: start, discovered: false };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-root.js","sourceRoot":"","sources":["../../src/utils/project-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"project-root.js","sourceRoot":"","sources":["../../src/utils/project-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,MAAM,eAAe,GAAG;IACtB,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ;IAC5E,SAAS,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,SAAS;IACzE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY;CACnF,CAAC;AAEF,SAAS,gBAAgB,CAAC,SAAiB;IACzC,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACrF,IAAI,CAAC;QAAC,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gCAAgC,CAAC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