Exemple #1
0
export function mergeVhd (
  parentRemote: Remote,
  parentPath: string,
  childRemote: Remote,
  childPath: string
) {
  return mergeVhd_(
    getHandler(parentRemote, config.remoteOptions),
    parentPath,
    getHandler(childRemote, config.remoteOptions),
    childPath
  )
}
Exemple #2
0
export default async function main (args) {
  if (args.length < 2 || args.some(_ => _ === '-h' || _ === '--help')) {
    return `Usage: ${this.command} <input VHD> <output VHD>`
  }

  const handler = getHandler({ url: 'file:///' })
  const stream = await createSyntheticStream(handler, path.resolve(args[0]))
  return new Promise((resolve, reject) => {
    stream.on('error', reject).pipe(
      createWriteStream(args[1])
        .on('error', reject)
        .on('finish', resolve)
    )
  })
}