-
Notifications
You must be signed in to change notification settings - Fork 5
A few starting issues #41
Description
I installed this in a virtualenv on my desktop and couldn't get the bak up <file> command to work.
I installed with this process:
git clone git clone https://github.com/bakfile/bak.git
'virtualenv bak/
source bak/bin/activate
python3 bak/setup.py install
When I just typed bak I would get a help menu so I assumed it was installed properly.
The problem occurs when I tried to use bak up test.cfg for the first time I got an error that looks like this:
> bak up test.cfg
Traceback (most recent call last):
File "/home/user/bak/bin/bak", line 33, in <module>
sys.exit(load_entry_point('bak==0.0.1a1', 'console_scripts', 'bak')())
File "/home/user/bak/lib/python3.6/site-packages/click-7.1.2-py3.6.egg/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/user/bak/lib/python3.6/site-packages/click-7.1.2-py3.6.egg/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/user/bak/lib/python3.6/site-packages/click-7.1.2-py3.6.egg/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/user/bak/lib/python3.6/site-packages/click-7.1.2-py3.6.egg/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/user/bak/lib/python3.6/site-packages/click-7.1.2-py3.6.egg/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/user/bak/lib/python3.6/site-packages/bak-0.0.1a1-py3.6.egg/bak/__main__.py", line 45, in bak_up
File "/home/user/bak/lib/python3.6/site-packages/bak-0.0.1a1-py3.6.egg/bak/commands/__init__.py", line 227, in bak_up_cmd
File "/home/user/bak/lib/python3.6/site-packages/bak-0.0.1a1-py3.6.egg/bak/commands/__init__.py", line 95, in _do_select_bakfile
I checked out the offending file and line number and it looks like this:
90 def _do_select_bakfile(bakfiles: List[bakfile.BakFile],
91 select_prompt=default_select_prompt,
92 err=True):
93 console = Console(file=stderr if err else stdout)
94 console.print(
95 f"Found {len(bakfiles)} bakfiles for file: {bakfiles[0].orig_abspath}")
96 console.print("Please select from the following: ")
97 console.print("Range %d", len(bakfiles))
On line 95 there is that bakfiles[0] reference, and since the error was a IndexError I figured it was the culprit. I commented those couple of print lines out and reinstalled it. After that I could run the bak up test.cfg command but I didn't really understand the menu that pops up after:
Enter a number to overwrite a .bakfile, or:
(V)iew (L)ist (C)ancel [C]:
This was sort of confusing and I didn't know what to do and after trying all the options I can say that the file seems to not have backed up anything.
I hope this can be a useful issue. I didn't dive into understanding the code much but am willing to help solve it with some direction.
Also, I think there is need for install guide in the README. I found a way to do it but I'm not sure if that is the best way.