MCPcopy Create free account
hub / github.com/Azure/powershell / extractXar

Function extractXar

lib/index.js:4175–4195  ·  view source on GitHub ↗

* Extract a xar compatible archive * * @param file path to the archive * @param dest destination directory. Optional. * @param flags flags for the xar. Optional. * @returns path to the destination directory

(file, dest, flags = [])

Source from the content-addressed store, hash-verified

4173 * @returns path to the destination directory
4174 */
4175function extractXar(file, dest, flags = []) {
4176 return __awaiter(this, void 0, void 0, function* () {
4177 assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
4178 assert_1.ok(file, 'parameter "file" is required');
4179 dest = yield _createExtractFolder(dest);
4180 let args;
4181 if (flags instanceof Array) {
4182 args = flags;
4183 }
4184 else {
4185 args = [flags];
4186 }
4187 args.push('-x', '-C', dest, '-f', file);
4188 if (core.isDebug()) {
4189 args.push('-v');
4190 }
4191 const xarPath = yield io.which('xar', true);
4192 yield exec_1.exec(`"${xarPath}"`, _unique(args));
4193 return dest;
4194 });
4195}
4196exports.extractXar = extractXar;
4197/**
4198 * Extract a zip

Callers

nothing calls this directly

Calls 3

_createExtractFolderFunction · 0.85
_uniqueFunction · 0.85
execMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…