run method

  1. @override
Future<Map> run(
  1. Env env,
  2. Map request
)
override

Implementation

@override
Future<Map> run(Env env, Map request) async {
  String read(String name) {
    final value = request[name];
    if (value == null) {
      logger.log('$name 未配置', status: LogStatus.error);
      exit(1);
    }
    return value;
  }

  final root = read('root');
  final umengAppKey = read('umengAppKey');
  final umengMessageSecret = read('umengMessageSecret');
  final umengChannel = read('umengChannel');
  await AddUmengPushConfig(
    root: root,
    umengAppKey: umengAppKey,
    umengMessageSecret: umengMessageSecret,
    umengChannel: umengChannel,
  ).add();
  return {};
}