Skip to content

Conversation

@mik-tf
Copy link

@mik-tf mik-tf commented Aug 18, 2025

Work Done

  • Added info for MacOS user to use Pal as seamlessly as with Linux
  • Tested on macOS Intel Sequoia, and it works well (the pal /commit feature was used for the 2 commits of this PR!)
  • Added info for how to use zsh with MacOS for Pal

Copy link
Owner

@scottyeager scottyeager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! See the comments per file for some needed changes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just use curl. It should always be there on Linux too, so we can keep it simple.

var storageDir string
if runtime.GOOS == "darwin" {
storageDir = filepath.Join(homeDir, "Library", "Application Support", "pal_helper")
} else {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically on the off chance that someone tries pal on FreeBSD, etc, they will also fall under this branch. As far as I can tell, using the XDG standard on these systems is okay. Maybe we can just mention this possibility in the comment, so it doesn't look like we are using a catchall else to mean linux.


// Clean up the old file if it exists. This shouldn't slow us down if the
// file no longer exists, since stat hits cached data
homeDir, _ := os.UserHomeDir()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be silently dropping the possible err here, I think. Better to keep what we had I think:

	if err != nil {
		return fmt.Errorf("failed to get home directory: %w", err)

storagePath, err := GetAbbrFilePath()
if err != nil {
return fmt.Errorf("failed to get home directory: %w", err)
return err
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also wrap this error to provide context. Not sure if we are doing that totally consistently, but it seems like a good idea.

## Quickstart

It's a single binary that you can just download into any location on your `$PATH`:
It's a single binary that you can download into any location on your `$PATH`:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can standardize on curl here too (see comment below). But why do we have a different curl invocation in the update command versus here on the README?

Also, let's put Linux at the top of the list :)

return `set -l pal_prefix "` + abbreviationPrefix + `"` + "\n" + FishAbbrEmbed + "\n"
path, err := inout.GetAbbrFilePath()
if err != nil {
// Fallback to Linux default if something goes wrong
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not blindly continue on error. Same for zsh.

@scottyeager
Copy link
Owner

Update here. I decided against using Library paths for MacOS. It's a bit of a rabbit hole, but I think using ~/.config and the XDG env var are fine for any Unix like system.

Changing to curl is probably still relevant. Need to double check the rest.

@mik-tf
Copy link
Author

mik-tf commented Nov 5, 2025

Great! So I guess we can close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants