Closed afandian closed 4 years ago
huh, what happens if you create the ~/.config/ultralist
directory manually?
Thanks. Different error this time
mkdir ~/.config/ultralist
$ ultralist init
It looks like a .todos.json file already exists! Doing nothing.
$ ultralist l
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x24 pc=0x362cc4]
goroutine 1 [running]:
github.com/ultralist/ultralist/ultralist.(*FileStore).GetLocation(0xc0c710, 0x3, 0xf0d04004)
/home/grant-work/code/go/src/github.com/ultralist/ultralist/ultralist/file_store.go:86 +0x78
github.com/ultralist/ultralist/ultralist.(*FileStore).Load(0xc0c710, 0xc3, 0x4050c8, 0x32, 0x20, 0x1)
/home/grant-work/code/go/src/github.com/ultralist/ultralist/ultralist/file_store.go:42 +0x26c
github.com/ultralist/ultralist/ultralist.(*App).Load(0xc0b840, 0x471378, 0x8a82a0)
/home/grant-work/code/go/src/github.com/ultralist/ultralist/ultralist/app.go:372 +0x28
github.com/ultralist/ultralist/ultralist.(*App).ListTodos(0xc0b840, 0x0, 0x0)
/home/grant-work/code/go/src/github.com/ultralist/ultralist/ultralist/app.go:287 +0x1c
github.com/ultralist/ultralist/cmd.glob..func17(0x8a2588, 0x8b7a2c, 0x0, 0x0)
/home/grant-work/code/go/src/github.com/ultralist/ultralist/cmd/list.go:56 +0x64
github.com/ultralist/ultralist/vendor/github.com/spf13/cobra.(*Command).execute(0x8a2588, 0x8b7a2c, 0x0, 0x0, 0x8a2588, 0x8b7a2c)
/home
...
Looking at both stack traces, I think this is probably user.Current()
. You ignore the return error from that here and here, but maybe that doesn't play nicely with the termux environment. It may just be a problem in the Go library.
($HOME
is set to /data/data/com.termux/files/home
by the way)
At the very least, a controlled abort (rather than ignore) if you can't get the user would help narrow it down.
Okay, so I think this is the answer: https://golang.org/src/os/user/lookup_android.go
@afandian I'd be happy to accept a PR! Looks like you're nearly there with a solution.
Also, I'm not sure your use case, but you might want to look into ultralist.io for managing your lists on mobile. The webapp is a progressive web app that works really well on android devices.
I'll certainly have a go at a PR, looks doable. I have an android with a keyboard (Gemini PDA) and I love ultralist CLI on the desktop. So the webapp is nice but I like the idea of having the same thing on my mobile.
We were just talking about this in an earlier PR. https://github.com/ultralist/ultralist/pull/168#discussion_r266818443
Maybe using os.UserHomeDir()
is the right way to fix this?
I've created a little PR for this: #181
@afandian maybe you can test this branch and see if this is working for you.
arm build runs on Android to show home screen but can't do anything with files.
I think this is caused by storage access?