How to ensure dotfiles is executable?

I end up trying to customize every codespace as the dotfiles repo is cloned, but it always seems to say the install.sh file is not executable.

Since I don’t provide any actual install command, just the script file, I’m not able to run chmod against it anyway. Am I supposed to do this in the dotfiles repo for the executable permission to persist or is there some other solution?

Related: Environment not being loaded (Dotfiles)

1 Like

Yes, you have to make install.sh executable in your dotfiles repo.

Shameless plug: chezmoi has great support for Codespaces, and has a dotfiles repo you can clone to get started.

This is really cool!
Side note… What is the main advantage you see of doing it with that tool vs say using ansible? I can think of a couple reasons but would be interested in seeing that added to the FAQ for folks that are interested but not certain what a new system might gain. Thanks for sharing this!

Thanks for the feedback :slight_smile:

I added an FAQ entry as you suggested. It’s:

Why not use Ansible/Chef/Puppet/Salt, or similar to manage my dotfiles instead?

Whole system management tools are more than capable of managing your dotfiles, but are large systems that entail several disadvantages. Compared to whole system management tools, chezmoi offers:

  • Small, focused feature set designed for dotfiles. There’s simply less to learn with chezmoi compared to whole system management tools.
  • Easy installation and execution on every platform, without root access. Installing chezmoi requires only copying a single binary file with no external dependencies. Executing chezmoi just involves running the binary. In contrast, installing and running a whole system management tools typically requires installing a scripting language runtime, several packages, and running a system service, all typically requiring root access.

chezmoi’s focus and simple installation means that it runs almost everywhere: from tiny ARM-based Linux systems to Windows desktops, from inside lightweight containers to FreeBSD-based virtual machines in the cloud.

1 Like

I ran this command and then committed/pushed:

git update-index --chmod=+x .\install.sh

I verified that the file is marked as executable in the Codespaces terminal, but it still fails to be run/found. From the Creation Log:

[VS Online][4b863330-61bc-45b9-a8e9-00bcc2c49aa0] bash: /var/lib/docker/vsonlinemount/.persistedshare/dotfiles/install.sh: No such file or directory
[VS Online][4b863330-61bc-45b9-a8e9-00bcc2c49aa0] Process exited with non - zero result (127).

This feature seems busted