Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be0c761cb3 | ||
|
|
4ebf3bd60f | ||
|
|
63547e74c2 | ||
|
|
79b630b622 |
@@ -17,6 +17,13 @@ Generate markdown documentation from directory structure. Optimized for LLM inge
|
|||||||
- Frontend only mode (include only frontend files and `README.md`)
|
- Frontend only mode (include only frontend files and `README.md`)
|
||||||
- Omit test files and inline test blocks (Go, Java, Rust)
|
- Omit test files and inline test blocks (Go, Java, Rust)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Only for linux.
|
||||||
|
Download binary from release page or install with go
|
||||||
|
```bash
|
||||||
|
go install git.flo.fo/FLO/dirmd@latest
|
||||||
|
```
|
||||||
|
|
||||||
## Use with Git Post Hook
|
## Use with Git Post Hook
|
||||||
combine with git post hook to sync with proton drive on each commit
|
combine with git post hook to sync with proton drive on each commit
|
||||||
|
|
||||||
|
|||||||
@@ -173,8 +173,6 @@ func run(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("failed to resolve output path: %w", err)
|
return fmt.Errorf("failed to resolve output path: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
absOutput = filepath.Join(filepath.Dir(absOutput), filepath.Base(absOutput)+"_dirmd")
|
|
||||||
|
|
||||||
if !appendMode {
|
if !appendMode {
|
||||||
if _, err := os.Stat(absOutput); err == nil && !force {
|
if _, err := os.Stat(absOutput); err == nil && !force {
|
||||||
return fmt.Errorf("output directory %s already exists (use -f to overwrite)", absOutput)
|
return fmt.Errorf("output directory %s already exists (use -f to overwrite)", absOutput)
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
# Automating sending files to proton drive on commits
|
|
||||||
|
|
||||||
If you add this to any repos, and have dirmd in path and logged in on proton drive cli, then after each commit the newest code is pushed to proton drive, as vertical slices. If you do not want vertical slices of the code omit --vertical-slices. Also check out the other flags of dirmd if required.
|
|
||||||
|
|
||||||
## repos-root/.git/hooks/post-commit
|
|
||||||
|
|
||||||
create this file
|
|
||||||
|
|
||||||
```sh
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
if ! command -v dirmd &>/dev/null; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
|
||||||
REPO_NAME=$(basename "$REPO_ROOT")
|
|
||||||
|
|
||||||
dirmd -o "/tmp/${REPO_NAME}_new" "$REPO_ROOT" -f --vertical-slices --proton-drive
|
|
||||||
```
|
|
||||||
|
|
||||||
and then make it executable with something like `chmod +x .git/hooks/post-commit`
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 522 KiB |
@@ -89,17 +89,9 @@ func Generate(cfg *config.Config) GenerateResult {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.VerticalSlices {
|
if err := drive.UploadDir(cfg.OutputPath, remoteDir); err != nil {
|
||||||
if err := drive.UploadDir(cfg.OutputPath, remoteDir); err != nil {
|
result.Error = fmt.Errorf("drive upload: %w", err)
|
||||||
result.Error = fmt.Errorf("drive upload: %w", err)
|
return result
|
||||||
return result
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
indexPath := filepath.Join(cfg.OutputPath, "index_"+repoName+".md")
|
|
||||||
if err := drive.Upload(indexPath, remoteDir); err != nil {
|
|
||||||
result.Error = fmt.Errorf("drive upload: %w", err)
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
result.Uploaded = true
|
result.Uploaded = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user