Skip to content

Commit

Permalink
Allow commands to run from the non root folder of the git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vHanda committed Jun 10, 2022
1 parent beeb966 commit 18f8a30
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ func daemonRm(ctx *cli.Context) error {
return tracerr.Wrap(err)
}

repoPath, err = isValidGitRepo(repoPath)
if err != nil {
return tracerr.Wrap(err)
}

config, err := cfg.Read()
if err != nil {
return tracerr.Wrap(err)
Expand Down
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ func main() {
return tracerr.Wrap(err)
}

repoPath, err = isValidGitRepo(repoPath)
if err != nil {
return tracerr.Wrap(err)
}

cfg, err := common.NewRepoConfig(repoPath)
if err != nil {
return tracerr.Wrap(err)
Expand All @@ -49,6 +54,11 @@ func main() {
return tracerr.Wrap(err)
}

repoPath, err = isValidGitRepo(repoPath)
if err != nil {
return tracerr.Wrap(err)
}

cfg, err := common.NewRepoConfig(repoPath)
if err != nil {
return tracerr.Wrap(err)
Expand Down
10 changes: 7 additions & 3 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
* Handle merge / merge-conflict (commit everything, pick newest, notify)
- Add the logs of operation to .git/logs/auto-sync
* Daemon - proper logs
* Daemon - status

* CLI auto-complete

Expand All @@ -10,8 +9,6 @@
* Ensure that the 'daemon' process can be found
- It seems it wasn't being installed by the homebrew package

* RPM / DEB packages - https://netdevops.me/2021/building-and-publishing-deb/rpm-packages-with-goreleaser-and-gemfury/

* Check the state of the git repo before
- Make sure it isn't in the middle of a rebase / merge
- Make sure that head commit is pointing to a branch
Expand All @@ -25,3 +22,10 @@
- Try to batch them together?
- Or optionally, it should only be saved when the editor is closed
- For vim this means figuring out the backupfile directory

* Empty files aren't being tracked? This behaviour needs to be documented

* Add a config checker to make sure things are good
* It doesn't seem to be tracking some deletes?

* These constant small small commits by Obsidian are annoying me. Have a simple way to do an append commit, and push it every '10 minutes' or so. Do not discount the annoyance caused by this.

0 comments on commit 18f8a30

Please sign in to comment.