Skip to content

Conversation

nzaytsev
Copy link
Contributor

@nzaytsev nzaytsev commented Dec 23, 2024

Description

All new installs files will be placed into platform specific folder

  • Linux: $XDG_DATA_HOME/gk (~/.local/share/gk)
  • Windows: %LOCALAPPDATA%/gk/Data (C:\Users<user>\AppData\Local\gk\Data)
  • MacOS: ~/Library/Application Support/gk

Existing installs data is placed at $HOME.gk directory. It can be changed manually by deleting .gk directory or moving to corresponding directory

https://github.com/sindresorhus/env-paths/tree/main could be used instead, it implements the logic

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@nzaytsev nzaytsev linked an issue Dec 23, 2024 that may be closed by this pull request

// export as a singleton
// eslint-disable-next-line import-x/no-default-export
export default new SharedGKDataFolderMapper();
Copy link
Member

Choose a reason for hiding this comment

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

Don't use a default export

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@nzaytsev nzaytsev force-pushed the debt/3660-gitlens-creates-a-gk-folder-in-the-home-dir branch 2 times, most recently from 75caad1 to 3d08906 Compare December 24, 2024 04:20
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

Works for me, just a few minor comments and suggestions.

} catch {
// File does not exist, so we can safely create it
break;
// Path does not exist, so we can safely use xdg paths it
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Path does not exist, so we can safely use xdg paths it
// Path does not exist, so we can safely use xdg paths

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, thank you

class SharedGKDataFolderMapper {
private _initPromise: Promise<void> | undefined;
constructor(
// do soft migration, use new folders only for new users (without existing folders)
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want to inform users who have a .gk folder, and want to use the new location, like many of the users in the original issue, that they should delete the former. Otherwise GitLens will continue using it.

In fact, they may want to take the contents out of that folder, delete it, and then move it into the new XDG-friendly folder so they don't lose the data.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, probably in the help center and on the issue, but I wouldn't say in the app

@nzaytsev nzaytsev force-pushed the debt/3660-gitlens-creates-a-gk-folder-in-the-home-dir branch 2 times, most recently from 851ddf4 to 4a10a5f Compare January 10, 2025 03:50
@nzaytsev nzaytsev force-pushed the debt/3660-gitlens-creates-a-gk-folder-in-the-home-dir branch from 4a10a5f to 03d4ccf Compare January 10, 2025 04:02
@nzaytsev nzaytsev merged commit d0762e5 into main Jan 10, 2025
2 checks passed
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.

GitLens creates a .gk folder in the home dir.

4 participants