sitePublishFuture method

Future<MessageOrPromptOrError> sitePublishFuture({
  1. String? privatekey,
  2. String? inner_path,
  3. bool sign = true,
  4. bool remove_missing_optional = false,
  5. bool update_changed_files = false,
})

Return: "ok" on success, the error message otherwise.

Implementation

Future<MessageOrPromptOrError> sitePublishFuture({
  String? privatekey,
  String? inner_path,
  bool sign = true,
  bool remove_missing_optional = false,
  bool update_changed_files = false,
}) async {
  var params = {};
  if (privatekey != null) params['privatekey'] = privatekey;
  if (inner_path != null) params['inner_path'] = inner_path;
  params['sign'] = sign;
  params['remove_missing_optional'] = remove_missing_optional;
  params['update_changed_files'] = update_changed_files;
  var resultStr = await ZeroNet.instance.cmdFuture(
    ZeroNetCmd.sitePublish,
    params: params,
  );
  return resultStr.toMsgOrPromptOrErr;
}