PathTildeHelper.

PathReplaceTilde(ICakeContext, FilePath) 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 FilePath PathReplaceTilde(this ICakeContext context, FilePath filePath)

Attributes

Type Description
CakeMethodAliasAttribute

Parameters

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

Return Value

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