Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

Shell

Nested types and modules

TypeDescription
CopyRecursiveMethod

Functions and values

Function or valueDescription
Shell.appendTextFiles newFileName files
Signature: newFileName:string -> files:seq<string> -> unit

Appends all given files to one file.

Parameters

  • newFileName - The target FileName.
  • files - The original FileNames as a sequence.
Shell.AppendTextFiles newFileName files
Signature: newFileName:string -> files:seq<string> -> unit
Attributes:
[<Obsolete("Please use appendTextFiles instead")>]
OBSOLETE

Please use appendTextFiles instead

Appends all given files to one file.

Parameters

  • newFileName - The target FileName.
  • files - The original FileNames as a sequence.
Shell.appendTextFilesWithEncoding(...)
Signature: encoding:Encoding -> newFileName:string -> files:seq<string> -> unit

Appends all given files to one file.

Parameters

  • newFileName - The target FileName.
  • files - The original FileNames as a sequence.
Shell.AppendTextFilesWithEncoding(...)
Signature: encoding:Encoding -> newFileName:string -> files:seq<string> -> unit
Attributes:
[<Obsolete("Please use appendTextFilesWithEncoding instead")>]
OBSOLETE

Please use appendTextFilesWithEncoding instead

Appends all given files to one file.

Parameters

  • newFileName - The target FileName.
  • files - The original FileNames as a sequence.
Shell.cd(path)
Signature: path:string -> unit

Changes working directory

Shell.chdir(path)
Signature: path:string -> unit

Changes working directory

Shell.cleanDir(path)
Signature: path:string -> unit

Cleans a directory by removing all files and sub-directories.

Shell.CleanDir(path)
Signature: path:string -> unit
Attributes:
[<Obsolete("Please use cleanDir instead")>]
OBSOLETE

Please use cleanDir instead

Cleans a directory by removing all files and sub-directories.

Shell.cleanDirs(dirs)
Signature: dirs:seq<string> -> unit

Cleans multiple directories

Shell.CleanDirs(dirs)
Signature: dirs:seq<string> -> unit
Attributes:
[<Obsolete("Please use cleanDirs instead")>]
OBSOLETE

Please use cleanDirs instead

Cleans multiple directories

Shell.compareFiles(...)
Signature: delete:bool -> originalFileName:string -> compareFileName:string -> bool

Compares the given files for changes. If delete is set to true then equal files will be removed.

Shell.CompareFiles(...)
Signature: delete:bool -> originalFileName:string -> compareFileName:string -> bool
Attributes:
[<Obsolete("Please use compareFiles instead")>]
OBSOLETE

Please use compareFiles instead

Compares the given files for changes. If delete is set to true then equal files will be removed.

Shell.copy target files
Signature: target:string -> files:seq<string> -> unit

Copies the files to the target.

Parameters

  • target - The target directory.
  • files - The original file names as a sequence.
Shell.Copy target files
Signature: target:string -> files:seq<string> -> unit
Attributes:
[<Obsolete("Please use copy instead")>]
OBSOLETE

Please use copy instead

Copies the files to the target.

Parameters

  • target - The target directory.
  • files - The original file names as a sequence.
Shell.copyCached target cacheDir files
Signature: target:string -> cacheDir:string -> files:seq<string> -> string list

Copies the files from a cache folder. If the files are not cached or the original files have a different write time the cache will be refreshed.

Parameters

  • target - The target FileName.
  • cacheDir - The cache directory.
  • files - The orginal files.
Shell.CopyCached target cacheDir files
Signature: target:string -> cacheDir:string -> files:seq<string> -> string list
Attributes:
[<Obsolete("Please use copyCached instead")>]
OBSOLETE

Please use copyCached instead

Copies the files from a cache folder. If the files are not cached or the original files have a different write time the cache will be refreshed.

Parameters

  • target - The target FileName.
  • cacheDir - The cache directory.
  • files - The orginal files.
Shell.copyDir target source filterFile
Signature: target:string -> source:string -> filterFile:(string -> bool) -> unit

Copies a directory recursivly. If the target directory does not exist, it will be created.

Parameters

  • target - The target directory.
  • source - The source directory.
  • filterFile - A file filter predicate.
Shell.CopyDir target source filterFile
Signature: target:string -> source:string -> filterFile:(string -> bool) -> unit
Attributes:
[<Obsolete("Please use copyDir instead")>]
OBSOLETE

Please use copyDir instead

Copies a directory recursivly. If the target directory does not exist, it will be created.

Parameters

  • target - The target directory.
  • source - The source directory.
  • filterFile - A file filter predicate.
Shell.copyFile target fileName
Signature: target:string -> fileName:string -> unit

Copies a single file to the target and overwrites the existing file.

Parameters

  • target - The target directory or file.
  • fileName - The FileName.
Shell.CopyFile target fileName
Signature: target:string -> fileName:string -> unit
Attributes:
[<Obsolete("Please use copyFile instead")>]
OBSOLETE

Please use copyFile instead

Copies a single file to the target and overwrites the existing file.

Parameters

  • target - The target directory or file.
  • fileName - The FileName.
Shell.copyFileIntoSubFolder(...)
Signature: target:string -> fileName:string -> unit

Copies a single file to a relative subfolder of the target.

Parameters

  • target - The target directory
  • fileName - The fileName
Shell.CopyFileIntoSubFolder(...)
Signature: target:string -> fileName:string -> unit
Attributes:
[<Obsolete("Please use copyFileIntoSubFolder instead")>]
OBSOLETE

Please use copyFileIntoSubFolder instead

Copies a single file to a relative subfolder of the target.

Parameters

  • target - The target directory
  • fileName - The fileName
Shell.copyFiles target files
Signature: target:string -> files:seq<string> -> unit

Copies the files to the target - Alias for Copy

Parameters

  • target - The target directory.
  • files - The orginal file names.
Shell.CopyFiles target files
Signature: target:string -> files:seq<string> -> unit
Attributes:
[<Obsolete("Please use copyFiles instead")>]
OBSOLETE

Please use copyFiles instead

Copies the files to the target - Alias for Copy

Parameters

  • target - The target directory.
  • files - The orginal file names.
Shell.copyFilesWithSubFolder(...)
Signature: targetDir:string -> files:IGlobbingPattern -> unit

Copies the given glob-matches into another directory by leaving relative paths in place based on the globbing base-directory

Sample

1: 
2: 
3: 
 !! "**/My*Glob*.exe"
 |> GlobbingPattern.setBaseDir "baseDir"
 |> Shell.copyFilesWithSubFolder "targetDir"
Shell.copyFileWithSubfolder(...)
Signature: baseDir:string -> target:string -> fileName:string -> unit

Copies a single file to the target folder preserving the folder structure starting from the specified base folder.

Parameters

  • baseDir - The base directory.
  • target - The target directory.
  • fileName - The file name.
Shell.CopyFileWithSubfolder(...)
Signature: baseDir:string -> target:string -> fileName:string -> unit
Attributes:
[<Obsolete("Please use copyFileWithSubfolder instead")>]
OBSOLETE

Please use copyFileWithSubfolder instead

Copies a single file to the target folder preserving the folder structure starting from the specified base folder.

Parameters

  • baseDir - The base directory.
  • target - The target directory.
  • fileName - The file name.
Shell.copyRecursive(...)
Signature: dir:string -> outputDir:string -> overWrite:bool -> string list

Copies the file structure recursively.

Shell.CopyRecursive(...)
Signature: dir:string -> outputDir:string -> overWrite:bool -> string list
Attributes:
[<Obsolete("Please use copyRecursive instead")>]
OBSOLETE

Please use copyRecursive instead

Copies the file structure recursively.

Shell.copyRecursive2(...)
Signature: method:CopyRecursiveMethod -> dir:string -> outputDir:string -> string list

Copies the file structure recursively.

Parameters

  • method - the method to decide which files get copied
  • dir - The source directory.
  • outputDir - The target directory.
Shell.CopyRecursive2(...)
Signature: method:CopyRecursiveMethod -> dir:string -> outputDir:string -> string list
Attributes:
[<Obsolete("Please use copyRecursive2 instead")>]
OBSOLETE

Please use copyRecursive2 instead

Copies the file structure recursively.

Parameters

  • method - the method to decide which files get copied
  • dir - The source directory.
  • outputDir - The target directory.
Shell.copyRecursiveTo(...)
Signature: overWrite:bool -> outputDir:string -> dir:string -> string list
Shell.CopyRecursiveTo(...)
Signature: overWrite:bool -> outputDir:string -> dir:string -> string list
Attributes:
[<Obsolete("Please use copyRecursiveTo instead")>]
OBSOLETE

Please use copyRecursiveTo instead

Shell.copyTo target files
Signature: target:string -> files:seq<string> -> unit

Copies the given files to the target.

Parameters

  • target - The target directory.
  • files - The original file names as a sequence.
Shell.CopyTo target files
Signature: target:string -> files:seq<string> -> unit
Attributes:
[<Obsolete("Please use copyTo instead")>]
OBSOLETE

Please use copyTo instead

Copies the given files to the target.

Parameters

  • target - The target directory.
  • files - The original file names as a sequence.
Shell.cp src dest
Signature: src:string -> dest:string -> unit

Like "cp" in a shell. Copies a single file. The source The destination

Shell.cp_r src dest
Signature: src:string -> dest:string -> unit

Like "cp -r" in a shell. Copies a file or directory recursively.

Shell.deleteDir(dir)
Signature: dir:string -> unit

Compat

Shell.DeleteDir(dir)
Signature: dir:string -> unit
Attributes:
[<Obsolete("Please use deleteDir instead")>]
OBSOLETE

Please use deleteDir instead

Compat

Shell.deleteDirs(dirs)
Signature: dirs:seq<string> -> unit

Deletes multiple directories

Shell.DeleteDirs(dirs)
Signature: dirs:seq<string> -> unit
Attributes:
[<Obsolete("Please use deleteDirs instead")>]
OBSOLETE

Please use deleteDirs instead

Deletes multiple directories

Shell.generatePatch(...)
Signature: lastReleaseDir:string -> patchDir:string -> srcFiles:seq<string> -> unit

Checks the srcFiles for changes to the last release.

Parameters

  • lastReleaseDir - The directory of the last release.
  • patchDir - The target directory.
  • srcFiles - The source files.
Shell.GeneratePatch(...)
Signature: lastReleaseDir:string -> patchDir:string -> srcFiles:seq<string> -> unit
Attributes:
[<Obsolete("Please use generatePatch instead")>]
OBSOLETE

Please use generatePatch instead

Checks the srcFiles for changes to the last release.

Parameters

  • lastReleaseDir - The directory of the last release.
  • patchDir - The target directory.
  • srcFiles - The source files.
Shell.generatePatchWithFindOldFileFunction(...)
Signature: lastReleaseDir:string -> patchDir:string -> srcFiles:seq<string> -> findOldFileF:(string -> string -> string) -> unit

Checks the srcFiles for changes to the last release.

Parameters

  • lastReleaseDir - The directory of the last release
  • patchDir - The target directory
  • srcFiles - The source files
  • findOldFileF - A function which finds the old file
Shell.GeneratePatchWithFindOldFileFunction(...)
Signature: lastReleaseDir:string -> patchDir:string -> srcFiles:seq<string> -> findOldFileF:(string -> string -> string) -> unit
Attributes:
[<Obsolete("Please use generatePatchWithFindOldFileFunction instead")>]
OBSOLETE

Please use generatePatchWithFindOldFileFunction instead

Checks the srcFiles for changes to the last release.

Parameters

  • lastReleaseDir - The directory of the last release
  • patchDir - The target directory
  • srcFiles - The source files
  • findOldFileF - A function which finds the old file
Shell.mkdir(path)
Signature: path:string -> unit

Creates a directory if it doesn't exist.

Shell.moveFile target fileName
Signature: target:string -> fileName:string -> unit

Moves a single file to the target and overwrites the existing file. If fileName is a directory the functions does nothing.

Parameters

  • target - The target directory.
  • fileName - The FileName.
Shell.MoveFile target fileName
Signature: target:string -> fileName:string -> unit
Attributes:
[<Obsolete("Please use moveFile instead")>]
OBSOLETE

Please use moveFile instead

Moves a single file to the target and overwrites the existing file.

Parameters

  • target - The target directory.
  • fileName - The FileName.
Shell.mv src dest
Signature: src:string -> dest:string -> unit

Like "mv" in a shell. Moves/renames a file The source The destination

Shell.popd()
Signature: unit -> unit

Restore the previous directory stored in the stack

Shell.pushd(path)
Signature: path:string -> unit

Store the current directory in the directory stack before changing to a new one

Shell.pwd()
Signature: unit -> string

Gets working directory

Shell.regexReplaceInFilesWithEncoding(...)
Signature: pattern:string -> replacement:string -> encoding:Encoding -> files:seq<string> -> unit

Replace all occurences of the regex pattern with the given replacement in the specified files

Parameters

  • pattern - The string to search for a match
  • replacement - The replacement string
  • encoding - The encoding to use when reading and writing the files
  • files - The paths of the files to process
Shell.RegexReplaceInFilesWithEncoding(...)
Signature: pattern:string -> replacement:string -> encoding:Encoding -> files:seq<string> -> unit
Attributes:
[<Obsolete("Please use regexReplaceInFilesWithEncoding instead")>]
OBSOLETE

Please use regexReplaceInFilesWithEncoding instead

Replace all occurences of the regex pattern with the given replacement in the specified files

Parameters

  • pattern - The string to search for a match
  • replacement - The replacement string
  • encoding - The encoding to use when reading and writing the files
  • files - The paths of the files to process
Shell.regexReplaceInFileWithEncoding(...)
Signature: pattern:string -> replacement:string -> encoding:Encoding -> file:string -> unit

Replace all occurences of the regex pattern with the given replacement in the specified file

Parameters

  • pattern - The string to search for a match
  • replacement - The replacement string
  • encoding - The encoding to use when reading and writing the file
  • file - The path of the file to process
Shell.RegexReplaceInFileWithEncoding(...)
Signature: pattern:string -> replacement:string -> encoding:Encoding -> file:string -> unit
Attributes:
[<Obsolete("Please use regexReplaceInFileWithEncoding instead")>]
OBSOLETE

Please use regexReplaceInFileWithEncoding instead

Replace all occurences of the regex pattern with the given replacement in the specified file

Parameters

  • pattern - The string to search for a match
  • replacement - The replacement string
  • encoding - The encoding to use when reading and writing the file
  • file - The path of the file to process
Shell.rename target fileName
Signature: target:string -> fileName:string -> unit

Renames the file or directory to the target name.

Parameters

  • target - The target file or directory name.
  • fileName - The orginal file or directory name.
Shell.Rename target fileName
Signature: target:string -> fileName:string -> unit
Attributes:
[<Obsolete("Please use rename instead")>]
OBSOLETE

Please use rename instead

Renames the file or directory to the target name.

Parameters

  • target - The target file or directory name.
  • fileName - The orginal file or directory name.
Shell.replaceInFiles replacements files
Signature: replacements:seq<string * string> -> files:seq<string> -> unit

Replaces all occurences of the patterns in the given files with the given replacements.

Parameters

  • replacements - A sequence of tuples with the patterns and the replacements.
  • files - The files to process.
Shell.ReplaceInFiles replacements files
Signature: replacements:seq<string * string> -> files:seq<string> -> unit
Attributes:
[<Obsolete("Please use replaceInFiles instead")>]
OBSOLETE

Please use replaceInFiles instead

Replaces all occurences of the patterns in the given files with the given replacements.

Parameters

  • replacements - A sequence of tuples with the patterns and the replacements.
  • files - The files to process.
Shell.rm(fileName)
Signature: fileName:string -> unit

Deletes a file if it exists

Shell.rm_rf(f)
Signature: f:string -> unit

Like "rm -rf" in a shell. Removes files recursively, ignoring nonexisting files

Shell.silentCopy target files
Signature: target:string -> files:seq<string> -> unit

Copies a list of files to the specified directory without any output.

Parameters

  • target - The target directory.
  • files - List of files to copy.
Shell.SilentCopy target files
Signature: target:string -> files:seq<string> -> unit
Attributes:
[<Obsolete("Please use silentCopy instead")>]
OBSOLETE

Please use silentCopy instead

Copies a list of files to the specified directory without any output.

Parameters

  • target - The target directory.
  • files - List of files to copy.
Shell.testDir(path)
Signature: path:string -> bool

Checks if the directory exists

Shell.TestDir(path)
Signature: path:string -> bool
Attributes:
[<Obsolete("Please use testDir instead")>]
OBSOLETE

Please use testDir instead

Checks if the directory exists

Shell.testFile(path)
Signature: path:string -> bool

Checks if the file exists

Shell.TestFile(path)
Signature: path:string -> bool
Attributes:
[<Obsolete("Please use testFile instead")>]
OBSOLETE

Please use testFile instead

Checks if the file exists

Shell.writeConfigFile(...)
Signature: configFileName:string -> parameters:seq<'?19861 * '?19862> -> unit
Type parameters: '?19861, '?19862

Creates a config file with the parameters as "key;value" lines

Shell.WriteConfigFile(...)
Signature: configFileName:string -> parameters:seq<'?19892 * '?19893> -> unit
Type parameters: '?19892, '?19893 Attributes:
[<Obsolete("Please use writeConfigFile instead")>]
OBSOLETE

Please use writeConfigFile instead

Creates a config file with the parameters as "key;value" lines