node-simctl 8.0.9 → 8.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/lib/helpers.d.ts +17 -9
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +50 -4
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/logger.d.ts +2 -3
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +3 -5
- package/build/lib/logger.js.map +1 -1
- package/build/lib/simctl.d.ts +82 -188
- package/build/lib/simctl.d.ts.map +1 -1
- package/build/lib/simctl.js +98 -150
- package/build/lib/simctl.js.map +1 -1
- package/build/lib/subcommands/addmedia.d.ts +14 -16
- package/build/lib/subcommands/addmedia.d.ts.map +1 -1
- package/build/lib/subcommands/addmedia.js +5 -7
- package/build/lib/subcommands/addmedia.js.map +1 -1
- package/build/lib/subcommands/appinfo.d.ts +13 -45
- package/build/lib/subcommands/appinfo.d.ts.map +1 -1
- package/build/lib/subcommands/appinfo.js +31 -42
- package/build/lib/subcommands/appinfo.js.map +1 -1
- package/build/lib/subcommands/boot.d.ts +9 -12
- package/build/lib/subcommands/boot.d.ts.map +1 -1
- package/build/lib/subcommands/boot.js +5 -40
- package/build/lib/subcommands/boot.js.map +1 -1
- package/build/lib/subcommands/bootstatus.d.ts +16 -56
- package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
- package/build/lib/subcommands/bootstatus.js +8 -22
- package/build/lib/subcommands/bootstatus.js.map +1 -1
- package/build/lib/subcommands/create.d.ts +15 -34
- package/build/lib/subcommands/create.d.ts.map +1 -1
- package/build/lib/subcommands/create.js +23 -66
- package/build/lib/subcommands/create.js.map +1 -1
- package/build/lib/subcommands/delete.d.ts +9 -12
- package/build/lib/subcommands/delete.d.ts.map +1 -1
- package/build/lib/subcommands/delete.js +3 -5
- package/build/lib/subcommands/delete.js.map +1 -1
- package/build/lib/subcommands/erase.d.ts +12 -15
- package/build/lib/subcommands/erase.d.ts.map +1 -1
- package/build/lib/subcommands/erase.js +4 -6
- package/build/lib/subcommands/erase.js.map +1 -1
- package/build/lib/subcommands/get_app_container.d.ts +19 -22
- package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
- package/build/lib/subcommands/get_app_container.js +6 -8
- package/build/lib/subcommands/get_app_container.js.map +1 -1
- package/build/lib/subcommands/getenv.d.ts +11 -14
- package/build/lib/subcommands/getenv.d.ts.map +1 -1
- package/build/lib/subcommands/getenv.js +5 -7
- package/build/lib/subcommands/getenv.js.map +1 -1
- package/build/lib/subcommands/install.d.ts +12 -15
- package/build/lib/subcommands/install.d.ts.map +1 -1
- package/build/lib/subcommands/install.js +4 -6
- package/build/lib/subcommands/install.js.map +1 -1
- package/build/lib/subcommands/io.d.ts +12 -15
- package/build/lib/subcommands/io.d.ts.map +1 -1
- package/build/lib/subcommands/io.js +4 -6
- package/build/lib/subcommands/io.js.map +1 -1
- package/build/lib/subcommands/keychain.d.ts +37 -55
- package/build/lib/subcommands/keychain.d.ts.map +1 -1
- package/build/lib/subcommands/keychain.js +16 -25
- package/build/lib/subcommands/keychain.js.map +1 -1
- package/build/lib/subcommands/launch.d.ts +16 -19
- package/build/lib/subcommands/launch.d.ts.map +1 -1
- package/build/lib/subcommands/launch.js +9 -11
- package/build/lib/subcommands/launch.js.map +1 -1
- package/build/lib/subcommands/list.d.ts +94 -125
- package/build/lib/subcommands/list.d.ts.map +1 -1
- package/build/lib/subcommands/list.js +34 -92
- package/build/lib/subcommands/list.js.map +1 -1
- package/build/lib/subcommands/location.d.ts +18 -22
- package/build/lib/subcommands/location.d.ts.map +1 -1
- package/build/lib/subcommands/location.js +11 -13
- package/build/lib/subcommands/location.js.map +1 -1
- package/build/lib/subcommands/openurl.d.ts +15 -17
- package/build/lib/subcommands/openurl.d.ts.map +1 -1
- package/build/lib/subcommands/openurl.js +5 -7
- package/build/lib/subcommands/openurl.js.map +1 -1
- package/build/lib/subcommands/pbcopy.d.ts +14 -17
- package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
- package/build/lib/subcommands/pbcopy.js +5 -7
- package/build/lib/subcommands/pbcopy.js.map +1 -1
- package/build/lib/subcommands/pbpaste.d.ts +14 -17
- package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
- package/build/lib/subcommands/pbpaste.js +5 -7
- package/build/lib/subcommands/pbpaste.js.map +1 -1
- package/build/lib/subcommands/privacy.d.ts +52 -57
- package/build/lib/subcommands/privacy.d.ts.map +1 -1
- package/build/lib/subcommands/privacy.js +15 -17
- package/build/lib/subcommands/privacy.js.map +1 -1
- package/build/lib/subcommands/push.d.ts +22 -25
- package/build/lib/subcommands/push.d.ts.map +1 -1
- package/build/lib/subcommands/push.js +5 -7
- package/build/lib/subcommands/push.js.map +1 -1
- package/build/lib/subcommands/shutdown.d.ts +9 -12
- package/build/lib/subcommands/shutdown.d.ts.map +1 -1
- package/build/lib/subcommands/shutdown.js +5 -40
- package/build/lib/subcommands/shutdown.js.map +1 -1
- package/build/lib/subcommands/spawn.d.ts +24 -27
- package/build/lib/subcommands/spawn.d.ts.map +1 -1
- package/build/lib/subcommands/spawn.js +12 -14
- package/build/lib/subcommands/spawn.js.map +1 -1
- package/build/lib/subcommands/terminate.d.ts +12 -15
- package/build/lib/subcommands/terminate.d.ts.map +1 -1
- package/build/lib/subcommands/terminate.js +4 -6
- package/build/lib/subcommands/terminate.js.map +1 -1
- package/build/lib/subcommands/ui.d.ts +97 -105
- package/build/lib/subcommands/ui.d.ts.map +1 -1
- package/build/lib/subcommands/ui.js +24 -26
- package/build/lib/subcommands/ui.js.map +1 -1
- package/build/lib/subcommands/uninstall.d.ts +13 -16
- package/build/lib/subcommands/uninstall.d.ts.map +1 -1
- package/build/lib/subcommands/uninstall.js +4 -6
- package/build/lib/subcommands/uninstall.js.map +1 -1
- package/build/lib/types.d.ts +231 -0
- package/build/lib/types.d.ts.map +1 -0
- package/build/lib/types.js +3 -0
- package/build/lib/types.js.map +1 -0
- package/index.ts +13 -0
- package/lib/helpers.ts +81 -0
- package/lib/{logger.js → logger.ts} +2 -5
- package/lib/simctl.ts +221 -0
- package/lib/subcommands/{addmedia.js → addmedia.ts} +6 -8
- package/lib/subcommands/appinfo.ts +39 -0
- package/lib/subcommands/{boot.js → boot.ts} +5 -10
- package/lib/subcommands/bootstatus.ts +108 -0
- package/lib/subcommands/{create.js → create.ts} +29 -35
- package/lib/subcommands/{delete.js → delete.ts} +3 -5
- package/lib/subcommands/{erase.js → erase.ts} +4 -7
- package/lib/subcommands/{get_app_container.js → get_app_container.ts} +10 -8
- package/lib/subcommands/{getenv.js → getenv.ts} +5 -7
- package/lib/subcommands/{install.js → install.ts} +4 -6
- package/lib/subcommands/{io.js → io.ts} +4 -7
- package/lib/subcommands/{keychain.js → keychain.ts} +30 -32
- package/lib/subcommands/{launch.js → launch.ts} +9 -12
- package/lib/subcommands/{list.js → list.ts} +67 -60
- package/lib/subcommands/{location.js → location.ts} +15 -14
- package/lib/subcommands/{openurl.js → openurl.ts} +6 -7
- package/lib/subcommands/{pbcopy.js → pbcopy.ts} +11 -8
- package/lib/subcommands/{pbpaste.js → pbpaste.ts} +5 -7
- package/lib/subcommands/{privacy.js → privacy.ts} +13 -17
- package/lib/subcommands/{push.js → push.ts} +5 -8
- package/lib/subcommands/{shutdown.js → shutdown.ts} +5 -8
- package/lib/subcommands/{spawn.js → spawn.ts} +21 -17
- package/lib/subcommands/{terminate.js → terminate.ts} +4 -6
- package/lib/subcommands/{ui.js → ui.ts} +19 -28
- package/lib/subcommands/{uninstall.js → uninstall.ts} +4 -6
- package/lib/types.ts +243 -0
- package/package.json +2 -3
- package/index.js +0 -4
- package/lib/helpers.js +0 -37
- package/lib/simctl.js +0 -299
- package/lib/subcommands/appinfo.js +0 -51
- package/lib/subcommands/bootstatus.js +0 -119
|
@@ -1,53 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.bootDevice = bootDevice;
|
|
39
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
40
|
-
const logger_1 =
|
|
41
|
-
const commands = {};
|
|
8
|
+
const logger_1 = require("../logger");
|
|
42
9
|
/**
|
|
43
10
|
* Boot the particular Simulator if it is not running.
|
|
44
11
|
*
|
|
45
|
-
* @this {import('../simctl').Simctl}
|
|
46
12
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
47
13
|
* returns non-zero return code.
|
|
48
14
|
* @throws {Error} If the `udid` instance property is unset
|
|
49
15
|
*/
|
|
50
|
-
|
|
16
|
+
async function bootDevice() {
|
|
51
17
|
try {
|
|
52
18
|
await this.exec('boot', {
|
|
53
19
|
args: [this.requireUdid('boot')]
|
|
@@ -57,8 +23,7 @@ commands.bootDevice = async function bootDevice() {
|
|
|
57
23
|
if (lodash_1.default.includes(e.message, 'Unable to boot device in current state: Booted')) {
|
|
58
24
|
throw e;
|
|
59
25
|
}
|
|
60
|
-
logger_1.
|
|
26
|
+
logger_1.log.debug(logger_1.LOG_PREFIX, `Simulator already in 'Booted' state. Continuing`);
|
|
61
27
|
}
|
|
62
|
-
}
|
|
63
|
-
exports.default = commands;
|
|
28
|
+
}
|
|
64
29
|
//# sourceMappingURL=boot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../../lib/subcommands/boot.
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":";;;;;AAWA,gCAWC;AAtBD,oDAAuB;AACvB,sCAA4C;AAG5C;;;;;;GAMG;AACI,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACtB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAI,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,gDAAgD,CAAC,EAAE,CAAC;YAC5E,MAAM,CAAC,CAAC;QACV,CAAC;QACD,YAAG,CAAC,KAAK,CAAC,mBAAU,EAAE,iDAAiD,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC"}
|
|
@@ -1,57 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
onFinished?: Function | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* - This event is fired when there was an error while monitoring the booting process
|
|
21
|
-
* or when the timeout has expired.
|
|
22
|
-
*/
|
|
23
|
-
onError?: Function | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Whether to preboot the Simulator
|
|
26
|
-
* if this command is called and it is not already in booted or booting state.
|
|
27
|
-
*/
|
|
28
|
-
shouldPreboot?: boolean | undefined;
|
|
29
|
-
};
|
|
30
|
-
declare namespace commands {
|
|
31
|
-
/**
|
|
32
|
-
* @typedef {Object} BootMonitorOptions
|
|
33
|
-
* @property {number} [timeout=240000] - Simulator booting timeout in ms.
|
|
34
|
-
* @property {Function} [onWaitingDataMigration] - This event is fired when data migration stage starts.
|
|
35
|
-
* @property {Function} [onWaitingSystemApp] - This event is fired when system app wait stage starts.
|
|
36
|
-
* @property {Function} [onFinished] - This event is fired when Simulator is fully booted.
|
|
37
|
-
* @property {Function} [onError] - This event is fired when there was an error while monitoring the booting process
|
|
38
|
-
* or when the timeout has expired.
|
|
39
|
-
* @property {boolean} [shouldPreboot=false] Whether to preboot the Simulator
|
|
40
|
-
* if this command is called and it is not already in booted or booting state.
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* Start monitoring for boot status of the particular Simulator.
|
|
44
|
-
* If onFinished property is not set then the method will block
|
|
45
|
-
* until Simulator booting is completed.
|
|
46
|
-
* The method is only available since Xcode8.
|
|
47
|
-
*
|
|
48
|
-
* @this {import('../simctl').Simctl}
|
|
49
|
-
* @param {BootMonitorOptions} [opts={}] - Monitoring options.
|
|
50
|
-
* @returns {Promise<import('teen_process').SubProcess>} The instance of the corresponding monitoring process.
|
|
51
|
-
* @throws {Error} If the Simulator fails to finish booting within the given timeout and onFinished
|
|
52
|
-
* property is not set.
|
|
53
|
-
* @throws {Error} If the `udid` instance property is unset
|
|
54
|
-
*/
|
|
55
|
-
function startBootMonitor(this: import("../simctl").default, opts?: BootMonitorOptions): Promise<import("teen_process").SubProcess>;
|
|
56
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
import type { BootMonitorOptions } from '../types';
|
|
3
|
+
import type { SubProcess } from 'teen_process';
|
|
4
|
+
/**
|
|
5
|
+
* Start monitoring for boot status of the particular Simulator.
|
|
6
|
+
* If onFinished property is not set then the method will block
|
|
7
|
+
* until Simulator booting is completed.
|
|
8
|
+
* The method is only available since Xcode8.
|
|
9
|
+
*
|
|
10
|
+
* @param opts - Monitoring options.
|
|
11
|
+
* @returns The instance of the corresponding monitoring process.
|
|
12
|
+
* @throws {Error} If the Simulator fails to finish booting within the given timeout and onFinished
|
|
13
|
+
* property is not set.
|
|
14
|
+
* @throws {Error} If the `udid` instance property is unset
|
|
15
|
+
*/
|
|
16
|
+
export declare function startBootMonitor(this: Simctl, opts?: BootMonitorOptions): Promise<SubProcess>;
|
|
57
17
|
//# sourceMappingURL=bootstatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstatus.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.
|
|
1
|
+
{"version":3,"file":"bootstatus.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,UAAU,CAAC,CAoFrB"}
|
|
@@ -3,38 +3,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
exports.startBootMonitor = startBootMonitor;
|
|
7
|
+
const logger_1 = require("../logger");
|
|
7
8
|
const asyncbox_1 = require("asyncbox");
|
|
8
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
-
const commands = {};
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {Object} BootMonitorOptions
|
|
12
|
-
* @property {number} [timeout=240000] - Simulator booting timeout in ms.
|
|
13
|
-
* @property {Function} [onWaitingDataMigration] - This event is fired when data migration stage starts.
|
|
14
|
-
* @property {Function} [onWaitingSystemApp] - This event is fired when system app wait stage starts.
|
|
15
|
-
* @property {Function} [onFinished] - This event is fired when Simulator is fully booted.
|
|
16
|
-
* @property {Function} [onError] - This event is fired when there was an error while monitoring the booting process
|
|
17
|
-
* or when the timeout has expired.
|
|
18
|
-
* @property {boolean} [shouldPreboot=false] Whether to preboot the Simulator
|
|
19
|
-
* if this command is called and it is not already in booted or booting state.
|
|
20
|
-
*/
|
|
21
10
|
/**
|
|
22
11
|
* Start monitoring for boot status of the particular Simulator.
|
|
23
12
|
* If onFinished property is not set then the method will block
|
|
24
13
|
* until Simulator booting is completed.
|
|
25
14
|
* The method is only available since Xcode8.
|
|
26
15
|
*
|
|
27
|
-
* @
|
|
28
|
-
* @
|
|
29
|
-
* @returns {Promise<import('teen_process').SubProcess>} The instance of the corresponding monitoring process.
|
|
16
|
+
* @param opts - Monitoring options.
|
|
17
|
+
* @returns The instance of the corresponding monitoring process.
|
|
30
18
|
* @throws {Error} If the Simulator fails to finish booting within the given timeout and onFinished
|
|
31
19
|
* property is not set.
|
|
32
20
|
* @throws {Error} If the `udid` instance property is unset
|
|
33
21
|
*/
|
|
34
|
-
|
|
22
|
+
async function startBootMonitor(opts = {}) {
|
|
35
23
|
const { timeout = 240000, onWaitingDataMigration, onWaitingSystemApp, onFinished, onError, shouldPreboot, } = opts;
|
|
36
24
|
const udid = this.requireUdid('bootstatus');
|
|
37
|
-
/** @type {string[]} */
|
|
38
25
|
const status = [];
|
|
39
26
|
let isBootingFinished = false;
|
|
40
27
|
let error = null;
|
|
@@ -47,7 +34,7 @@ commands.startBootMonitor = async function startBootMonitor(opts = {}) {
|
|
|
47
34
|
args,
|
|
48
35
|
asynchronous: true,
|
|
49
36
|
});
|
|
50
|
-
const onStreamLine = (
|
|
37
|
+
const onStreamLine = (line) => {
|
|
51
38
|
status.push(line);
|
|
52
39
|
if (onWaitingDataMigration && line.includes('Waiting on Data Migration')) {
|
|
53
40
|
onWaitingDataMigration();
|
|
@@ -86,7 +73,7 @@ commands.startBootMonitor = async function startBootMonitor(opts = {}) {
|
|
|
86
73
|
await bootMonitor.stop();
|
|
87
74
|
}
|
|
88
75
|
catch (e) {
|
|
89
|
-
logger_1.
|
|
76
|
+
logger_1.log.warn(e.message);
|
|
90
77
|
}
|
|
91
78
|
}
|
|
92
79
|
};
|
|
@@ -111,6 +98,5 @@ commands.startBootMonitor = async function startBootMonitor(opts = {}) {
|
|
|
111
98
|
}
|
|
112
99
|
}
|
|
113
100
|
return bootMonitor;
|
|
114
|
-
}
|
|
115
|
-
exports.default = commands;
|
|
101
|
+
}
|
|
116
102
|
//# sourceMappingURL=bootstatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstatus.js","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.
|
|
1
|
+
{"version":3,"file":"bootstatus.js","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.ts"],"names":[],"mappings":";;;;;AAmBA,4CAuFC;AA1GD,sCAAgC;AAChC,uCAA4C;AAC5C,oDAAuB;AAKvB;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,gBAAgB,CAEpC,OAA2B,EAAE;IAE3B,MAAM,EACJ,OAAO,GAAG,MAAM,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,aAAa,GACd,GAAG,IAAI,CAAC;IACT,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAC9B,IAAI,KAAK,GAAiB,IAAI,CAAC;IAC/B,IAAI,cAAc,GAA0B,IAAI,CAAC;IACjD,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;QAChD,IAAI;QACJ,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;QACpC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,sBAAsB,IAAI,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC;YACzE,sBAAsB,EAAE,CAAC;QAC3B,CAAC;aAAM,IAAI,kBAAkB,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;YACxE,kBAAkB,EAAE,CAAC;QACvB,CAAC;IACH,CAAC,CAAC;IACF,KAAK,MAAM,UAAU,IAAI,CA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G,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,MAAM,IAAA,2BAAgB,EAAC,GAAG,EAAE;gBAC1B,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,KAAK,CAAC;gBACd,CAAC;gBACD,OAAO,iBAAiB,CAAC;YAC3B,CAAC,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAC,CAAC,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,WAAW,EAAE,CAAC;YACpB,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CACb,iBAAiB,IAAI,uCAAuC,OAAO,KAAK;gBACxE,oBAAoB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACxC,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC;AACvB,CAAC"}
|
|
@@ -1,35 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @property {string} [platform='iOS'] - Platform name in order to specify runtime such as 'iOS', 'tvOS', 'watchOS'
|
|
17
|
-
* @property {number} [timeout=10000] - The maximum number of milliseconds to wait
|
|
18
|
-
* unit device creation is completed.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Create Simulator device with given name for the particular
|
|
22
|
-
* platform type and version.
|
|
23
|
-
*
|
|
24
|
-
* @this {import('../simctl').Simctl}
|
|
25
|
-
* @param {string} name - The device name to be created.
|
|
26
|
-
* @param {string} deviceTypeId - Device type, for example 'iPhone 6'.
|
|
27
|
-
* @param {string} platformVersion - Platform version, for example '10.3'.
|
|
28
|
-
* @param {SimCreationOpts} [opts={}] - Simulator options for creating devices.
|
|
29
|
-
* @return {Promise<string>} The UDID of the newly created device.
|
|
30
|
-
* @throws {Error} If the corresponding simctl subcommand command
|
|
31
|
-
* returns non-zero return code.
|
|
32
|
-
*/
|
|
33
|
-
function createDevice(this: import("../simctl").default, name: string, deviceTypeId: string, platformVersion: string, opts?: SimCreationOpts): Promise<string>;
|
|
34
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
import type { SimCreationOpts } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Create Simulator device with given name for the particular
|
|
5
|
+
* platform type and version.
|
|
6
|
+
*
|
|
7
|
+
* @param name - The device name to be created.
|
|
8
|
+
* @param deviceTypeId - Device type, for example 'iPhone 6'.
|
|
9
|
+
* @param platformVersion - Platform version, for example '10.3'.
|
|
10
|
+
* @param opts - Simulator options for creating devices.
|
|
11
|
+
* @return The UDID of the newly created device.
|
|
12
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
13
|
+
* returns non-zero return code.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createDevice(this: Simctl, name: string, deviceTypeId: string, platformVersion: string, opts?: SimCreationOpts): Promise<string>;
|
|
35
16
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/create.
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/create.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EACvB,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,MAAM,CAAC,CAkFjB"}
|
|
@@ -1,70 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createDevice = createDevice;
|
|
39
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
40
|
-
const logger_1 =
|
|
8
|
+
const logger_1 = require("../logger");
|
|
41
9
|
const asyncbox_1 = require("asyncbox");
|
|
42
10
|
const helpers_1 = require("../helpers");
|
|
43
11
|
const SIM_RUNTIME_NAME_SUFFIX_IOS = 'iOS';
|
|
44
12
|
const DEFAULT_CREATE_SIMULATOR_TIMEOUT = 10000;
|
|
45
|
-
const commands = {};
|
|
46
|
-
/**
|
|
47
|
-
* @typedef {Object} SimCreationOpts
|
|
48
|
-
* @property {string} [platform='iOS'] - Platform name in order to specify runtime such as 'iOS', 'tvOS', 'watchOS'
|
|
49
|
-
* @property {number} [timeout=10000] - The maximum number of milliseconds to wait
|
|
50
|
-
* unit device creation is completed.
|
|
51
|
-
*/
|
|
52
13
|
/**
|
|
53
14
|
* Create Simulator device with given name for the particular
|
|
54
15
|
* platform type and version.
|
|
55
16
|
*
|
|
56
|
-
* @
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
60
|
-
* @
|
|
61
|
-
* @return {Promise<string>} The UDID of the newly created device.
|
|
17
|
+
* @param name - The device name to be created.
|
|
18
|
+
* @param deviceTypeId - Device type, for example 'iPhone 6'.
|
|
19
|
+
* @param platformVersion - Platform version, for example '10.3'.
|
|
20
|
+
* @param opts - Simulator options for creating devices.
|
|
21
|
+
* @return The UDID of the newly created device.
|
|
62
22
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
63
23
|
* returns non-zero return code.
|
|
64
24
|
*/
|
|
65
|
-
|
|
25
|
+
async function createDevice(name, deviceTypeId, platformVersion, opts = {}) {
|
|
66
26
|
const { platform = SIM_RUNTIME_NAME_SUFFIX_IOS, timeout = DEFAULT_CREATE_SIMULATOR_TIMEOUT } = opts;
|
|
67
|
-
|
|
27
|
+
const runtimeIds = [];
|
|
68
28
|
// Try getting runtimeId using JSON flag
|
|
69
29
|
try {
|
|
70
30
|
runtimeIds.push(await this.getRuntimeForPlatformVersionViaJson(platformVersion, platform));
|
|
@@ -78,12 +38,12 @@ commands.createDevice = async function createDevice(name, deviceTypeId, platform
|
|
|
78
38
|
runtimeId = await this.getRuntimeForPlatformVersion(platformVersion, platform);
|
|
79
39
|
}
|
|
80
40
|
catch {
|
|
81
|
-
logger_1.
|
|
41
|
+
logger_1.log.warn(`Unable to find runtime for iOS '${platformVersion}'. Continuing`);
|
|
82
42
|
runtimeId = platformVersion;
|
|
83
43
|
}
|
|
84
44
|
// get the possible runtimes, which will be iterated over
|
|
85
45
|
// start with major-minor version
|
|
86
|
-
|
|
46
|
+
const potentialRuntimeIds = [(0, helpers_1.normalizeVersion)(runtimeId)];
|
|
87
47
|
if (runtimeId.split('.').length === 3) {
|
|
88
48
|
// add patch version if it exists
|
|
89
49
|
potentialRuntimeIds.push(runtimeId);
|
|
@@ -95,7 +55,7 @@ commands.createDevice = async function createDevice(name, deviceTypeId, platform
|
|
|
95
55
|
// go through the runtime ids and try to create a simulator with each
|
|
96
56
|
let udid;
|
|
97
57
|
for (const runtimeId of runtimeIds) {
|
|
98
|
-
logger_1.
|
|
58
|
+
logger_1.log.debug(logger_1.LOG_PREFIX, `Creating simulator with name '${name}', device type id '${deviceTypeId}' and runtime id '${runtimeId}'`);
|
|
99
59
|
try {
|
|
100
60
|
const { stdout } = await this.exec('create', {
|
|
101
61
|
args: [name, deviceTypeId, runtimeId]
|
|
@@ -115,24 +75,21 @@ commands.createDevice = async function createDevice(name, deviceTypeId, platform
|
|
|
115
75
|
// make sure that it gets out of the "Creating" state
|
|
116
76
|
const retries = parseInt(`${timeout / 1000}`, 10);
|
|
117
77
|
await (0, asyncbox_1.retryInterval)(retries, 1000, async () => {
|
|
118
|
-
const devices = lodash_1.default.values(await this.getDevices());
|
|
119
|
-
for (const
|
|
120
|
-
|
|
121
|
-
if (device.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
78
|
+
const devices = lodash_1.default.flatMap(lodash_1.default.values(await this.getDevices()));
|
|
79
|
+
for (const device of devices) {
|
|
80
|
+
if (device.udid === udid) {
|
|
81
|
+
if (device.state === 'Creating') {
|
|
82
|
+
// need to retry
|
|
83
|
+
throw new Error(`Device with udid '${udid}' still being created`);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
// stop looking, we're done
|
|
87
|
+
return;
|
|
130
88
|
}
|
|
131
89
|
}
|
|
132
90
|
}
|
|
133
91
|
throw new Error(`Device with udid '${udid}' not yet created`);
|
|
134
92
|
});
|
|
135
93
|
return udid;
|
|
136
|
-
}
|
|
137
|
-
exports.default = commands;
|
|
94
|
+
}
|
|
138
95
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../lib/subcommands/create.
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../lib/subcommands/create.ts"],"names":[],"mappings":";;;;;AAsBA,oCAwFC;AA9GD,oDAAuB;AACvB,sCAA4C;AAC5C,uCAAyC;AACzC,wCAAgE;AAIhE,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAC1C,MAAM,gCAAgC,GAAG,KAAK,CAAC;AAE/C;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,YAAY,CAEhC,IAAY,EACZ,YAAoB,EACpB,eAAuB,EACvB,OAAwB,EAAE;IAE1B,MAAM,EACJ,QAAQ,GAAG,2BAA2B,EACtC,OAAO,GAAG,gCAAgC,EAC3C,GAAG,IAAI,CAAC;IAET,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,wCAAwC;IACxC,IAAI,CAAC;QACH,UAAU,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,mCAAmC,C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IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
function deleteDevice(this: import("../simctl").default): Promise<void>;
|
|
12
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
/**
|
|
3
|
+
* Delete the particular Simulator from available devices list.
|
|
4
|
+
*
|
|
5
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
6
|
+
* returns non-zero return code.
|
|
7
|
+
* @throws {Error} If the `udid` instance property is unset
|
|
8
|
+
*/
|
|
9
|
+
export declare function deleteDevice(this: Simctl): Promise<void>;
|
|
13
10
|
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/delete.
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/D"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.deleteDevice = deleteDevice;
|
|
4
4
|
/**
|
|
5
5
|
* Delete the particular Simulator from available devices list.
|
|
6
6
|
*
|
|
7
|
-
* @this {import('../simctl').Simctl}
|
|
8
7
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
9
8
|
* returns non-zero return code.
|
|
10
9
|
* @throws {Error} If the `udid` instance property is unset
|
|
11
10
|
*/
|
|
12
|
-
|
|
11
|
+
async function deleteDevice() {
|
|
13
12
|
await this.exec('delete', {
|
|
14
13
|
args: [this.requireUdid('delete')]
|
|
15
14
|
});
|
|
16
|
-
}
|
|
17
|
-
exports.default = commands;
|
|
15
|
+
}
|
|
18
16
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../lib/subcommands/delete.
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../lib/subcommands/delete.ts"],"names":[],"mappings":";;AASA,oCAIC;AAXD;;;;;;GAMG;AACI,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QACxB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;KACnC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
function eraseDevice(this: import("../simctl").default, timeout?: number): Promise<void>;
|
|
15
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
/**
|
|
3
|
+
* Reset the content and settings of the particular Simulator.
|
|
4
|
+
* It is required that Simulator is in _shutdown_ state.
|
|
5
|
+
*
|
|
6
|
+
* @param timeout - The maximum number of milliseconds to wait
|
|
7
|
+
* unit device reset is completed.
|
|
8
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
9
|
+
* returns non-zero return code.
|
|
10
|
+
* @throws {Error} If the `udid` instance property is unset
|
|
11
|
+
*/
|
|
12
|
+
export declare function eraseDevice(this: Simctl, timeout?: number): Promise<void>;
|
|
16
13
|
//# sourceMappingURL=erase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erase.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/erase.
|
|
1
|
+
{"version":3,"file":"erase.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/erase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAQtF"}
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.eraseDevice = eraseDevice;
|
|
3
4
|
const asyncbox_1 = require("asyncbox");
|
|
4
|
-
const commands = {};
|
|
5
5
|
/**
|
|
6
6
|
* Reset the content and settings of the particular Simulator.
|
|
7
7
|
* It is required that Simulator is in _shutdown_ state.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
10
|
-
* @param {number} [timeout=10000] - The maximum number of milliseconds to wait
|
|
9
|
+
* @param timeout - The maximum number of milliseconds to wait
|
|
11
10
|
* unit device reset is completed.
|
|
12
11
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
13
12
|
* returns non-zero return code.
|
|
14
13
|
* @throws {Error} If the `udid` instance property is unset
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
async function eraseDevice(timeout = 1000) {
|
|
17
16
|
// retry erase with a sleep in between because it's flakey
|
|
18
17
|
const retries = parseInt(`${timeout / 200}`, 10);
|
|
19
18
|
await (0, asyncbox_1.retryInterval)(retries, 200, async () => await this.exec('erase', {
|
|
20
19
|
args: [this.requireUdid('erase')]
|
|
21
20
|
}));
|
|
22
|
-
}
|
|
23
|
-
exports.default = commands;
|
|
21
|
+
}
|
|
24
22
|
//# sourceMappingURL=erase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erase.js","sourceRoot":"","sources":["../../../lib/subcommands/erase.
|
|
1
|
+
{"version":3,"file":"erase.js","sourceRoot":"","sources":["../../../lib/subcommands/erase.ts"],"names":[],"mappings":";;AAaA,kCAQC;AArBD,uCAAyC;AAGzC;;;;;;;;;GASG;AACI,KAAK,UAAU,WAAW,CAAgB,UAAkB,IAAI;IACrE,0DAA0D;IAC1D,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,OAAO,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IACjD,MAAM,IAAA,wBAAa,EAAC,OAAO,EAAE,GAAG,EAC9B,KAAK,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QACnC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAClC,CAAC,CACH,CAAC;AACJ,CAAC"}
|