This PR introduces the get_relative_path function, which computes the relative path from a given base path to a specified file. The function signature is as follows:
The get_relative_path function takes two parameters:
filename: The absolute path of the target file.
base_path: The absolute path of the base directory.
The function returns a string representing the relative path from base_path to filename. This is useful in scenarios where relative paths are needed for portability, readability, or other path manipulations.
Usage Examples
Below are some examples demonstrating how to use the get_relative_path function:
Feature Description
This PR introduces the get_relative_path function, which computes the relative path from a given base path to a specified file. The function signature is as follows:
Functionality
The get_relative_path function takes two parameters:
The function returns a string representing the relative path from base_path to filename. This is useful in scenarios where relative paths are needed for portability, readability, or other path manipulations.
Usage Examples
Below are some examples demonstrating how to use the get_relative_path function:
Testing
Comprehensive tests have been added to ensure the correctness of the get_relative_path function. The tests cover various scenarios, including:
Related to https://github.com/aseprite/aseprite/pull/4389
I agree that my contributions are licensed under the MIT License. You can find a copy of this license at https://opensource.org/licenses/MIT