stagedDescriptor method

ServiceDescriptor stagedDescriptor(
  1. ServiceDescriptor d
)

d rewritten to launch the staged copy, without performing the copy (used by --dry-run). Returns d unchanged when it already points at the staged path.

Implementation

svc.ServiceDescriptor stagedDescriptor(svc.ServiceDescriptor d) {
  // Already staged (the runtime lives in our bin dir): leave it untouched so
  // re-staging does not re-prefix the filename.
  if (_samePath(_parentDir(_runtimeSource(d)), runtimeDir(d))) return d;
  final target = stagedRuntimePath(d);
  return _isDartVm(d)
      ? d.copyWith(arguments: [target, ...d.arguments.skip(1)])
      : d.copyWith(executablePath: target);
}