Skip to content

Latest commit

 

History

History
151 lines (93 loc) · 3.58 KB

MANUAL.md

File metadata and controls

151 lines (93 loc) · 3.58 KB

🏗 File system extra CLI - Manual

🏁 Quickstart

Each command is available:

  • either as a stand alone one, e.g. fse-copy or fse-cli-copy,
  • or as a sub command, e.g. fse copy or fse-cli copy.

The options and arguments are the same as those of Node.js: fs-extra unless otherwise stated.

🎹 Commands

When launching a job with prompting, by default the user is asked the arguments for which there is no default or inline value. To force prompting for all the arguments, add the option '--all'.

To suppress output when it makes sens (i.e. not an error or an output of query command), use either the option '--quiet' or the environment variable FSE_CLI_QUIET=true.

Version

Display @atao60/fse-cli version (and Node.js: fs-extra version).

fse version

Help

Display the present manual.

fse help

Copy file or directory

From the fs-extra documentation:

"Copy a file or directory. The directory can have contents. Like cp -r."

Follow the prompts

fse copy

Power user style

fse copy --all --keepExisting --errorOnExist --dereference --preserveTimestamps --quiet <source path> <destination path>

Note. --keepExisting behaves as the opposite of fs-extra's --overwrite.

Creating directories

From the fs-extra documentation:

"Ensures that the directory exists. If the directory structure does not exist, it is created. Like mkdir -p."

Aliases: ensureDir, mkdirs, mkdirp

Follow the prompts

fse mkdirp

Power user style

fse mkdirp --all --mode <integer> --quiet <new directory's path>

Cleaning directories

From the fs-extra documentation:

"Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted."

Follow the prompts

fse emptyDir

Power user style

fse emptyDir --quiet <directory's path>

Deleting files and directories

From the fs-extra documentation:

"Removes a file or directory. The directory can have contents. If the path does not exist, silently does nothing. Like rm -rf."

Aliases: remove, rimraf

Follow the prompts

fse remove

Power user style

fse remove --quiet <directory's path>

Creating files

From the fs-extra documentation:

"Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is NOT MODIFIED."

Aliases: ensureFile, touch

Follow the prompts

fse touch

Power user style

fse touch --quiet <new file's path>

Move file or directory

From the fs-extra documentation:

"Moves a file or directory, even across devices.
Note: When src is a file, dest must be a file and when src is a directory, dest must be a directory. "

Follow the prompts

fse move

Power user style

fse move --all --overwrite --quiet <source path> <destination path>