freshshell/fresh

permission denied to .fresh/build, now shell.sh compiled to .fresh/build.new

stephenkoo opened this issue · 2 comments

3 issues encountered due to what I believe is permission denied .fresh/build on macOS 11.5.2:

  1. My .zshrc source ~/.fresh/build/shell.sh command results in permission denied.
  2. I'm unable to run fresh cli commands with the error: 'zsh: permission denied: fresh'
  3. fresh --file symlinks are broken (e.g. fresh configs/asdf/tool-versions --file or fresh configs/starship.toml --file=~/.config/starship.toml

I first tried granting myself permission to ~/.fresh/build using chmod +x & chmod user:user but that doesn't seem to work.

Then I noticed that my fresh files are now compiled to ~/.fresh/build.new/ so as a workaround I've amended all references of build directories in my symlinks & .zshrc & the compiled fresh/build.new/shell.sh itself to build.new.
This "fixes" the first and third issue but the fresh cli commands still do not work.

Even if it did work, I'd need to repeat the manual steps of changing references from build to build.new whenever running fresh.

I'm not sure why suddenly I've lost permission to acces the .fresh/build directory. Any ideas?

Fresh builds into ~/.fresh/build.new first and then replaces the existing ~/.fresh/build once complete. This is to avoid having an incomplete build at ~/.fresh/build should something go wrong. The build.new directory should not exist if the build has completed successfully.

I am not aware of anything built-in which should result in you losing permissions to ~/.fresh/build. Since fresh is able to write to ~/.fresh/build.new, this suggests permissions after probably fine at the ~/.fresh level. Fresh itself will only ever replace ~/.fresh/build with a complete ~/.fresh/build.new.

I’d suggest running rm -rf ~/.fresh/build and then running ~/.fresh/source/freshshell/fresh/bin/fresh to rebuild. You should always be run the fresh binary directly from the source directory if your build is broken.

Hi @jasoncodes - thanks for the explanation, yes it's working now after sudo rm -rf ~/.fresh/build & re-running the fresh binary.
Appreciate your help.