通常我会避免使用基于 snap 的应用程序,但有时我需要它们。
例如 - Markdown Lint Tool 仅以 Snap 命名 mdl
。
当文件在主文件夹中时它工作得很好 -
$ echo "# header" > ~/test.md
$ /snap/bin/mdl ~/test.md ; echo $?
0
但是当文件位于/tmp
目录中时它会失败:
$ echo "# header" > /tmp/test.md
$ cat /tmp/test.md
# header
$ /snap/bin/mdl /tmp/test.md
/snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl/doc.rb:57:in `read': No such file or directory @ rb_sysopen - /tmp/test.md (Errno::ENOENT)
from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl/doc.rb:57:in `new_from_file'
from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:75:in `block in run'
from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:73:in `each'
from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:73:in `run'
from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/bin/mdl:10:in `<top (required)>'
from /snap/mdl/140/bin/mdl:23:in `load'
from /snap/mdl/140/bin/mdl:23:in `<main>'
对于此特定应用程序,没有以下选项snap connect
:
$ snap connections | grep mdl
home mdl:home :home -
我也不能将它安装为经典:
$ snap install mdl --classic
Warning: flag --classic ignored for strictly confined snap mdl
mdl 0.9.0 from Snapcrafters installed
我应该怎么做才能让 Snap 应用程序完全访问该/tmp
文件夹?
它是由 Snap 设计发生的吗?