PathTildeHelper.

PathReplaceTilde(ICakeContext, DirectoryPath) Method

Summary

Creates a path string with any leading tilde (~) character, used to denote the current user path, replaced with the absolute path to the current user's directory.

Syntax

public static DirectoryPath PathReplaceTilde(this ICakeContext context, DirectoryPath directoryPath)

Attributes

Type Description
CakeMethodAliasAttribute

Parameters

Name Type Description
context ICakeContext The context.
directoryPath DirectoryPath Path potentially containing a leading tilde character (~) to denote a path relative to the current user's directory.

Return Value

Type Description
DirectoryPath If the directoryPath contains a leading tilde character (~), returns an new string with the absolute path to the same location (user path replacing the tilde). If the directoryPath doesn't contain a tilde, a copy of the original string is returned.