Documentationcurrent version
Help us improve the docs by fixing typos and proposing enhancements.

Nikita

Action "fs.base.rename"

Change the name or location of a file.

Schema definitions

definitions =
  config:
    type: 'object'
    properties:
      'source':
        type: 'string'
        description: '''
        Location of the file to rename.
        '''
      'target':
        type: 'string'
        description: '''
        New name of the file.
        '''
    required: ['source', 'target']

Handler

handler = ({config}) ->
  await @execute
    command: "mv #{config.source} #{config.target}"
    trim: true

Exports

module.exports =
  handler: handler
  metadata:
    argument_to_config: 'target'
    log: false
    raw_output: true
    definitions: definitions
Edit on GitHub
Navigate
About

Nikita is an open source project hosted on GitHub and developed by Adaltas.