steam-deck-utilities icon indicating copy to clipboard operation
steam-deck-utilities copied to clipboard

Make swap path and home directory completely dynamic

Open xeome opened this issue 2 years ago • 3 comments

This pull request makes the swap path and home directory completely dynamic.

xeome avatar Feb 23 '23 14:02 xeome

A couple suggestions:

  • When joining file paths it's almost always better to use filepath.Join as it'll make sure the path is valid joined correctly.
  • If DefaultSwapFileLocation is just calling getSwapFileLocation() it should be removed entirely and replaced with the function. This is especially true as getSwapFileLocation returns an error that's currently completely ignored.

CalebQ42 avatar Feb 23 '23 14:02 CalebQ42

When joining file paths it's almost always better to use filepath.Join as it'll make sure the path is valid joined correctly.

I agree here, since #31 standardized all of the joins.

If DefaultSwapFileLocation is just calling getSwapFileLocation() it should be removed entirely and replaced with the function. This is especially true as getSwapFileLocation returns an error that's currently completely ignored.

Also agreed. This will let us surface the error closer to the user if necessary. We'll also no longer need BTRFSSwapFileLocation, as that was only there to compensate for the hard-coded path.

CryoByte33 avatar Feb 23 '23 14:02 CryoByte33

I made the suggested changes, thanks for teaching me. I recently started learning go.

xeome avatar Feb 23 '23 15:02 xeome

I just tested this and it looks great. I'm waiting for the merge of #52 to accept this. Would you mind incrementing the version number to 2.0.3?

CryoByte33 avatar Mar 01 '23 11:03 CryoByte33