Summary
Makes the file path relative (if absolute) to a specified root directory. If no root directory is defined
the current working directory is used as default root.
- Namespace
- Cake
.Common .IO - Containing Type
- DirectoryAliases
Syntax
[CakeMethodAlias]
[CakeAliasCategory("Path")]
public static FilePath MakeRelative(this ICakeContext context, FilePath path, DirectoryPath rootPath = null)
Examples
var path = MakeRelative(Directory("C:\Cake\Tests\Integration\file.cake"));
Attributes
Type | Description |
---|---|
Cake |
An attribute used to mark script method aliases. |
Cake |
An attribute used for documentation of alias methods/properties. |
Parameters
Name | Type | Description |
---|---|---|
context | ICakeContext | The context. |
path | FilePath | The path. |
rootPath | DirectoryPath | The root path. |
Return Value
Type | Description |
---|---|
FilePath | A relative file path. |