1

When I create a file without a dot (hidden) and use gh, (Github cli), to create a gist, it works. But when I change it to a hidden file it fails to read a file.

# I can create a gist with a normal file.
shinichi@shinichi-Ubuntu:~$ gh gist create /home/shinichi/testing-gh
- Creating gist testing-gh
✓ Created gist testing-gh
https://gist.github.com/b2cd617f8cf35dc54986f5855ae92b1f

checking permissions

shinichi@shinichi-Ubuntu:~$ ls -al ~/testing-gh -rw-rw-r-- 1 shinichi shinichi 42 Jul 30 08:40 /home/shinichi/testing-gh

Changing the file to a hidden one

shinichi@shinichi-Ubuntu:~$ mv testing-gh ./.testing-gh

Creating a Gist fails

shinichi@shinichi-Ubuntu:~$ gh gist create /home/shinichi/.testing-gh failed to collect files for posting: failed to read file /home/shinichi/.testing-gh: open /home/shinichi/.testing-gh: permission denied

checking the permission

shinichi@shinichi-Ubuntu:~$ ls -al ~/.testing-gh -rw-rw-r-- 1 shinichi shinichi 42 Jul 30 08:40 /home/shinichi/.testing-gh

This works on macOS, but not Ubuntu. Why is it? How can I fix the problem? How can I make a dotfiles Gist on Ubuntu?

muru
  • 197,895
  • 55
  • 485
  • 740
shin
  • 593

1 Answers1

1

Thank you for the link.

So I removed the snap gh:

sudo snap remove gh
sudo rm -rf ~/snap/gh

Then downloaded a Debian package from https://github.com/cli/cli/releases/tag/v1.13.1, then click to install it.

I'm going to uninstall all snap packages and replace them with sudo apt install. I must say I don't like the snap.

shin
  • 593