Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When there are functions as values, that hasn't been handled #1

Open
dinukadesilva opened this issue Jul 21, 2017 · 0 comments
Open

Comments

@dinukadesilva
Copy link

For an example, following goes to the front-end with null values assigned.

var config = [{
    type: 'expand',
    message: 'Overwrite ' + rfilepath + '?',
    choices: [{
      key: 'y',
      name: 'overwrite',
      value: function (cb) {
        self.adapter.log.force(rfilepath);
        return cb('force');
      }
    }, {
      key: 'n',
      name: 'do not overwrite',
      value: function (cb) {
        self.adapter.log.skip(rfilepath);
        return cb('skip');
      }
    }, {
      key: 'a',
      name: 'overwrite this and all others',
      value: function (cb) {
        self.adapter.log.force(rfilepath);
        self.force = true;
        return cb('force');
      }
    }, {
      key: 'x',
      name: 'abort',
      value: function (cb) {
        self.adapter.log.writeln('Aborting ...');
        return process.exit(0);
      }
    }, {
      key: 'd',
      name: 'show the differences between the old and the new',
      value: function (cb) {
        self.diff(fs.readFileSync(filepath, 'utf8'), content);
        return self._ask(filepath, content, cb);
      }
    }],
    name: 'overwrite'
  }];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant