Skip to content

Commit 18f8a30

Browse files
committed
Allow commands to run from the non root folder of the git repo
1 parent beeb966 commit 18f8a30

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

daemon.go

+5
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ func daemonRm(ctx *cli.Context) error {
137137
return tracerr.Wrap(err)
138138
}
139139

140+
repoPath, err = isValidGitRepo(repoPath)
141+
if err != nil {
142+
return tracerr.Wrap(err)
143+
}
144+
140145
config, err := cfg.Read()
141146
if err != nil {
142147
return tracerr.Wrap(err)

main.go

+10
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ func main() {
3131
return tracerr.Wrap(err)
3232
}
3333

34+
repoPath, err = isValidGitRepo(repoPath)
35+
if err != nil {
36+
return tracerr.Wrap(err)
37+
}
38+
3439
cfg, err := common.NewRepoConfig(repoPath)
3540
if err != nil {
3641
return tracerr.Wrap(err)
@@ -49,6 +54,11 @@ func main() {
4954
return tracerr.Wrap(err)
5055
}
5156

57+
repoPath, err = isValidGitRepo(repoPath)
58+
if err != nil {
59+
return tracerr.Wrap(err)
60+
}
61+
5262
cfg, err := common.NewRepoConfig(repoPath)
5363
if err != nil {
5464
return tracerr.Wrap(err)

todo.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
* Handle merge / merge-conflict (commit everything, pick newest, notify)
22
- Add the logs of operation to .git/logs/auto-sync
33
* Daemon - proper logs
4-
* Daemon - status
54

65
* CLI auto-complete
76

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

13-
* RPM / DEB packages - https://netdevops.me/2021/building-and-publishing-deb/rpm-packages-with-goreleaser-and-gemfury/
14-
1512
* Check the state of the git repo before
1613
- Make sure it isn't in the middle of a rebase / merge
1714
- Make sure that head commit is pointing to a branch
@@ -25,3 +22,10 @@
2522
- Try to batch them together?
2623
- Or optionally, it should only be saved when the editor is closed
2724
- For vim this means figuring out the backupfile directory
25+
26+
* Empty files aren't being tracked? This behaviour needs to be documented
27+
28+
* Add a config checker to make sure things are good
29+
* It doesn't seem to be tracking some deletes?
30+
31+
* 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 commit comments

Comments
 (0)