@driftless-sh/cli 0.1.43 → 0.1.44

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/git.js DELETED
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGitRemote = getGitRemote;
4
- exports.isGitRepo = isGitRepo;
5
- exports.getUncommittedDiff = getUncommittedDiff;
6
- exports.getStagedDiff = getStagedDiff;
7
- exports.getLastCommitHash = getLastCommitHash;
8
- exports.getAuthorName = getAuthorName;
9
- const node_child_process_1 = require("node:child_process");
10
- const node_fs_1 = require("node:fs");
11
- const node_path_1 = require("node:path");
12
- function getGitRemote() {
13
- try {
14
- const url = (0, node_child_process_1.execSync)('git config --get remote.origin.url', {
15
- encoding: 'utf8',
16
- cwd: process.cwd(),
17
- }).trim();
18
- // git@github.com:org/repo.git or https://github.com/org/repo.git
19
- const match = url.match(/[:/]([^/]+)\/([^/]+?)(?:\.git)?$/);
20
- if (match) {
21
- return { org: match[1], repo: match[2] };
22
- }
23
- return null;
24
- }
25
- catch {
26
- return null;
27
- }
28
- }
29
- function isGitRepo() {
30
- return (0, node_fs_1.existsSync)((0, node_path_1.resolve)(process.cwd(), '.git'));
31
- }
32
- function getUncommittedDiff() {
33
- try {
34
- return (0, node_child_process_1.execSync)('git diff', { encoding: 'utf8', cwd: process.cwd() }).trim();
35
- }
36
- catch {
37
- return '';
38
- }
39
- }
40
- function getStagedDiff() {
41
- try {
42
- return (0, node_child_process_1.execSync)('git diff --staged', { encoding: 'utf8', cwd: process.cwd() }).trim();
43
- }
44
- catch {
45
- return '';
46
- }
47
- }
48
- function getLastCommitHash() {
49
- try {
50
- return (0, node_child_process_1.execSync)('git rev-parse HEAD', { encoding: 'utf8', cwd: process.cwd() }).trim();
51
- }
52
- catch {
53
- return 'unknown';
54
- }
55
- }
56
- function getAuthorName() {
57
- try {
58
- return (0, node_child_process_1.execSync)('git config user.name', { encoding: 'utf8', cwd: process.cwd() }).trim();
59
- }
60
- catch {
61
- return 'unknown';
62
- }
63
- }
64
- //# sourceMappingURL=git.js.map
package/dist/git.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;AAIA,oCAgBC;AAED,8BAEC;AAED,gDAMC;AAED,sCAMC;AAED,8CAMC;AAED,sCAMC;AAxDD,2DAA6C;AAC7C,qCAAoC;AACpC,yCAAmC;AAEnC,SAAgB,YAAY;IAC1B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAA,6BAAQ,EAAC,oCAAoC,EAAE;YACzD,QAAQ,EAAE,MAAM;YAChB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;SACnB,CAAC,CAAC,IAAI,EAAE,CAAA;QAET,iEAAiE;QACjE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAA;QAC3D,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1C,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,SAAgB,SAAS;IACvB,OAAO,IAAA,oBAAU,EAAC,IAAA,mBAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC,CAAA;AACnD,CAAC;AAED,SAAgB,kBAAkB;IAChC,IAAI,CAAC;QACH,OAAO,IAAA,6BAAQ,EAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,SAAgB,aAAa;IAC3B,IAAI,CAAC;QACH,OAAO,IAAA,6BAAQ,EAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACvF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,SAAgB,iBAAiB;IAC/B,IAAI,CAAC;QACH,OAAO,IAAA,6BAAQ,EAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACxF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,SAAgB,aAAa;IAC3B,IAAI,CAAC;QACH,OAAO,IAAA,6BAAQ,EAAC,sBAAsB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}