Summary
Makes the directory 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 DirectoryPath MakeRelative(this ICakeContext context, DirectoryPath path, DirectoryPath rootPath = null)
Examples
var path = MakeRelative(Directory("C:\Cake\Tests\Integration"));
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 | DirectoryPath | The path. |
| rootPath | DirectoryPath | The root path. |
Return Value
| Type | Description |
|---|---|
| DirectoryPath | A relative directory path. |
