draftie 0.1.5 → 0.1.6
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 +5 -2
- package/dist/git.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,8 +61,11 @@ from another address, forms and iframes do not. The server refuses a file that h
|
|
|
61
61
|
`~/.draftie/config.json` holds the server's address and one API key per server.
|
|
62
62
|
`~/.draftie/drafts.json` holds which file was uploaded to which page.
|
|
63
63
|
|
|
64
|
-
Each upload also sends the git branch, commit, commit subject and whether the working
|
|
65
|
-
dirty, and in GitHub Actions the run's link and actor.
|
|
64
|
+
Each upload also sends the repository, git branch, commit, commit subject and whether the working
|
|
65
|
+
tree is dirty, and in GitHub Actions the run's link and actor. They come from the repository that
|
|
66
|
+
holds the file, or else from the one you run `draftie` in, so a file in a temporary folder still
|
|
67
|
+
counts toward your project. The dashboard groups drafts by repository and shows the rest per
|
|
68
|
+
version.
|
|
66
69
|
|
|
67
70
|
## For agents
|
|
68
71
|
|
package/dist/git.js
CHANGED
|
@@ -25,8 +25,9 @@ function parseRemote(remote) {
|
|
|
25
25
|
const parts = cleaned.split("/").filter(Boolean);
|
|
26
26
|
return parts.length >= 2 ? { org: parts.at(-2), name: parts.at(-1) } : {};
|
|
27
27
|
}
|
|
28
|
-
/** What git says about the
|
|
29
|
-
export function gitDetails(
|
|
28
|
+
/** What git says about the repository that holds `fileFolder`, or else the current folder. Every value is null outside a repository. */
|
|
29
|
+
export function gitDetails(fileFolder) {
|
|
30
|
+
const cwd = git(["rev-parse", "--show-toplevel"], fileFolder) === null ? process.cwd() : fileFolder;
|
|
30
31
|
const root = git(["rev-parse", "--show-toplevel"], cwd);
|
|
31
32
|
const remote = parseRemote(git(["config", "--get", "remote.origin.url"], cwd));
|
|
32
33
|
const status = git(["status", "--porcelain"], cwd);
|