get_file_name

A tool to get the filename from a given file path.

Arguments

NameTypeDescriptionRequired

path_to_file

string

The path to the file.

include_extension

boolean

Whether to include the file extension in the returned filename. Defaults to true.

Returns

TypeDescription

string

The filename with or without extension based on the include_extension argument.

Example

- name: get_file_name
  arguments:
    path_to_file: <file-path>
    include_extension: <true-or-false>
  returns: <filename>

Last updated