Skip to content

Conversation

@stevenjoezhang
Copy link
Member

@stevenjoezhang stevenjoezhang commented Apr 8, 2024

What does it do?

I have noticed that currently on Windows, paths in Hexo are converted frequently. For example, when adding files to the ctx.model('Cache') database, the path separators \ are replaced with /, and later when Assets use these paths, the join function is called, which on Windows, will replace / back with \. This pull request aims to standardize the separator in the cache's _id to match the current operating system's support and to avoid using hardcoded separators (using path.sep instead). It will not change existing functionalities but is intended to improve the uniformity and maintainability of the code.

WIP: pending #5385

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@github-actions
Copy link

github-actions bot commented Apr 8, 2024

How to test

git clone -b windows https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test

@stevenjoezhang stevenjoezhang marked this pull request as ready for review April 9, 2024 08:07
@stevenjoezhang stevenjoezhang requested a review from a team April 9, 2024 08:07
@stevenjoezhang stevenjoezhang merged commit 80dafe2 into master Apr 9, 2024
@stevenjoezhang stevenjoezhang deleted the windows branch April 9, 2024 12:16
@stevenjoezhang
Copy link
Member Author

See also hexojs/hexo-util#230

stevenjoezhang added a commit that referenced this pull request Apr 26, 2024
stevenjoezhang added a commit that referenced this pull request Apr 29, 2024
stevenjoezhang added a commit that referenced this pull request May 21, 2024
dimaslanjaka pushed a commit to dimaslanjaka/hexo that referenced this pull request Oct 3, 2024
dimaslanjaka pushed a commit to dimaslanjaka/hexo that referenced this pull request Oct 3, 2024
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.

3 participants