Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] path.relative API method #10080

Open
frankolson opened this issue Jun 18, 2024 · 2 comments
Open

[feat] path.relative API method #10080

frankolson opened this issue Jun 18, 2024 · 2 comments

Comments

@frankolson
Copy link

frankolson commented Jun 18, 2024

Describe the problem

I'm working with a couple projects where using the Tauri API to get the relative path between two files would be useful.

Describe the solution you'd like

I would like to update the Tauri commands and JS APIs to export a relative method/function similar to the one provided by the Node.js path module:

import { relative } from '@tauri/api/path';

// POSIX
relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb') == '../../impl/bbb';

// Windows
relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb') == '..\\..\\impl\\bbb';

Alternatives considered

Create a custom Tauri command in each project.

Additional context

Originally discussed in #8270, posted by Natejoestev back on November 20, 2023

@frankolson
Copy link
Author

I'm willing to create a PR for this work, but wanted to submit an issue first per the Pull Request Guidelines in the Tauri Contribution Guide

@amrbashir
Copy link
Member

amrbashir commented Jun 26, 2024

apologies for the late reply @frankolson, feel free to open a PR, thanks

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

No branches or pull requests

2 participants