Hello.
Every time I try to execute the init command switch for gshell, I get the following error:
cleitols@os:~$ gshell init
Traceback (most recent call last):
File "/usr/local/bin/gshell", line 8, in
sys.exit(main())
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 443, in main
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 125, in cmd_init
config_dir = init(name)
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 54, in init
init_config()
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 92, in init_config
home_id = _get_home_id()
File "/home/cleitols/.local/lib/python3.9/site-packages/gshell/init.py", line 84, in _get_home_id
parent_id = lines[1][start:end].strip()
IndexError: list index out of range
Probably it is due to a broken ~/.gshell file. The solution would be rm -f ~/.gshell
rm -f ~/.gshell
Tried to delete the file, but doesn't seem to be the reason yet.
I also tried to run the command as sudo and it went a little better, but the same error above is shown:
cleitols@os:~$ sudo gshell init
[sudo] password for cleitols:
Initializing system (/root/.gdrive)
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=367116221053-7n0vf5akeru7on6o2fjinrecpdoe99eg.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state
Enter verification code: ****
User: ****
Used: 300.5 MB
Free: 15.8 GB
Total: 16.1 GB
Max upload size: 5.2 TB
Traceback (most recent call last):
File "/usr/local/bin/gshell", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 443, in main
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 125, in cmd_init
config_dir = init(name)
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 54, in init
init_config()
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 92, in init_config
home_id = _get_home_id()
File "/usr/local/lib/python3.9/dist-packages/gshell/init.py", line 84, in _get_home_id
parent_id = lines[1][start:end].strip()
IndexError: list index out of range
Potentially this is because you don't have anything under your gdrive folder.
You can try to print the cmd and stdout in /usr/local/lib/python3.9/dist-packages/gshell/init.py to debug it.