text: // Generated by CoffeeScript 2.6.0
  // # `nikita.file.touch`
  
  // Create a empty file if it does not yet exists.
  
  // ## Implementation details
  
  // Status will only be true if the file was created.
  
  // ## Output
  
  // * `$status`   
  //   Value is "true" if file was created or modified.   
  
  // ## Example
  
  // ```js
  // const {$status} = await nikita.file.touch({
  //   target: '/tmp/a_file'
  // })
  // console.info(`File was touched: ${$status}`)
  // ```
  
  // ## Schema definitions
  var definitions, handler;
  
  definitions = {
    config: {
      type: 'object',
      properties: {
        'gid': {
          $ref: 'module://@nikitajs/file/lib/index#/definitions/config/properties/gid'
        },
        'mode': {
          $ref: 'module://@nikitajs/file/lib/index#/definitions/config/properties/mode'
        },
        'target': {
          oneOf: [
            {
              type: 'string'
            },
            {
              typeof: 'function'
            }
          ],
          description: `File path where to write file or a function that returns a valid file
  path.`
        },
        'uid': {
          $ref: 'module://@nikitajs/file/lib/index#/definitions/config/properties/uid'
        }
      },
      required: ['target']
    }
  };
  
  // ## Handler
  handler = async function({
      config,
      tools: {log}
    }) {
    var $status;
    ({$status} = (await this.call(async function() {
      var exists;
      log({
        message: `Check if target exists \"${config.target}\"`,
        level: 'DEBUG'
      });
      ({exists} = (await this.fs.base.exists({
        target: config.target
      })));
      if (!exists) {
        log({
          message: "Destination does not exists",
          level: 'INFO'
        });
      }
      return !exists;
    })));
    // if the file doesn't exist, create a new one
    if ($status) {
      await this.file({
        content: '',
        target: config.target,
        mode: config.mode,
        uid: config.uid,
        gid: config.gid
      });
    } else {
      // todo check uid/gid/mode
      // if the file exists, overwrite it using `touch` but don't update the status
      await this.execute({
        $shy: true,
        command: `touch ${config.target}`
      });
    }
    return {};
  };
  
  // ## Exports
  module.exports = {
    handler: handler,
    metadata: {
      argument_to_config: 'target',
      definitions: definitions
    }
  };
  