Score:1

dotfile failed to read file

de flag

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 avatar
us flag
How did you install the GitHub CLI? Is it a snap?
de flag
Yes. $ which gh /snap/bin/gh
muru avatar
us flag
Does this answer your question? [How to make snaps access hidden files and folders in ~/home?](https://askubuntu.com/questions/1238211/how-to-make-snaps-access-hidden-files-and-folders-in-home)
muru avatar
us flag
Looks like the GitHub CLI snap is defined to not be able access hidden files and directories. Probably only GitHub can change that.
Score:1
de flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.