sitePublishFuture method

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

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

Implementation

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