Comments (7)
Can you try this branch and tell me if it work?
pip install -U https://github.com/dbcli/litecli/archive/refs/heads/optional-config.zip
from litecli.
Litecli writes the default config file to ~/.config/litecli/config and it also uses that location to store the log files.
Can you try copying the liteclirc file into a location and launch litecli using:
litecli --liteclirc <PATH-TO-RC>
and see if that works?
from litecli.
@amjith same issue when
litecli --liteclirc /database/liteclirc
Traceback (most recent call last):
File "/usr/local/bin/litecli", line 8, in <module>
sys.exit(cli())
^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/litecli/main.py", line 921, in cli
litecli = LiteCli(
^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/litecli/main.py", line 123, in __init__
self.initialize_logging()
File "/usr/local/lib/python3.11/dist-packages/litecli/main.py", line 242, in initialize_logging
ensure_dir_exists(log_file)
File "/usr/local/lib/python3.11/dist-packages/litecli/config.py", line 30, in ensure_dir_exists
os.makedirs(parent_dir)
File "<frozen os>", line 215, in makedirs
File "<frozen os>", line 215, in makedirs
File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/nonexistent'
from litecli.
Can you try editing the log file location in your literc file?
https://github.com/dbcli/litecli/blob/main/litecli/liteclirc#L19
Set it to a location that is available in the docker container and see if that gets around it?
from litecli.
After creating the default, this ends up giving me.
nextjs@f095bfc4d0fe:/app$ litecli --liteclirc /tmp/liteclirc --logfile /tmp/txt.log
Traceback (most recent call last):
File "/usr/local/bin/litecli", line 8, in <module>
sys.exit(cli())
^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/litecli/main.py", line 921, in cli
litecli = LiteCli(
^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/litecli/main.py", line 78, in __init__
c = self.config = get_config(liteclirc)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/litecli/config.py", line 62, in get_config
return load_config(liteclirc_file, default_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/litecli/config.py", line 21, in load_config
cfg.merge(ConfigObj(expanduser(usr_cfg), interpolation=False, encoding="utf-8"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/configobj/__init__.py", line 1229, in __init__
self._load(infile, configspec)
File "/usr/local/lib/python3.11/dist-packages/configobj/__init__.py", line 1318, in _load
raise error
configobj.ConfigObjError: Parsing failed with several errors.
First error at line 129.
nextjs@f095bfc4d0fe:/app$
from litecli.
You're right that it shouldn't crash when it can't create the necessary folders. It'll be nice to print a warning that it failed to create them when the app starts so the user is aware.
If you're interested in contributing a PR, I'll be happy to merge it. If not, I'll take some time this upcoming week to implement it. Let me know what you prefer.
from litecli.
@amjith I can confirm this works ty!!!
from litecli.
Related Issues (20)
- When using .once -o, only last line remains HOT 2
- .schema: line breaks and missing index information
- “python_requires” should be set with “>=3.6”, as litecli 1.9.0 is not compatible with all Python versions
- feature request: sqlite3.38+ support for json to use its new features HOT 1
- Test failure with sqlparse==0.4.3
- Header names vague or hidden in grid mode HOT 2
- when insert to `table t(t text)` , raise an exception
- When long wide characters are stored in the database, it will not output some rows if enabled auto_vertical_output HOT 1
- STRICT tables seem to not be supported HOT 1
- FR: configuration to import custom python functions
- Feature comparison with SQLite CLI special commands (dot commands) HOT 1
- FR: support environment variables in (favourite) queries
- Cancelling a query leads to an error message, there is no 'KILL' command in sqlite HOT 1
- syntax style changes output behaviour HOT 1
- <null> entries in .schema output
- default prompt broken with very long filename?
- `startup_commands` fails when config value is a single string. HOT 4
- `--indent` with `.schema` doesnt work
- SyntaxWarning: invalid escape sequence '\e' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from litecli.