@arkts/image-manager 0.3.3 → 0.3.4
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/dist/index.cjs +2 -3
- package/dist/index.mjs +2 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -40,7 +40,7 @@ let unzipper = require("unzipper");
|
|
|
40
40
|
unzipper = __toESM(unzipper);
|
|
41
41
|
|
|
42
42
|
//#region package.json
|
|
43
|
-
var version = "0.3.
|
|
43
|
+
var version = "0.3.4";
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/devices/list.ts
|
|
@@ -302,12 +302,11 @@ var DeviceImpl = class {
|
|
|
302
302
|
return `${Object.entries(this.buildDeviceIni()).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => `${key}=${value}`).join("\n")}\n`;
|
|
303
303
|
}
|
|
304
304
|
async deploy() {
|
|
305
|
-
if (await this.isDeployed())
|
|
305
|
+
if (await this.isDeployed()) throw new DeployError(DeployError.Code.DEVICE_ALREADY_DEPLOYED, `Image ${this.options.name} already deployed`);
|
|
306
306
|
const { fs, path, deployedPath } = this.image.getImageManager().getOptions();
|
|
307
307
|
if (!fs.existsSync(deployedPath)) fs.mkdirSync(deployedPath, { recursive: true });
|
|
308
308
|
const listsPath = path.join(deployedPath, "lists.json");
|
|
309
309
|
const listConfig = this.buildList();
|
|
310
|
-
if (fs.existsSync(listConfig.path)) throw new DeployError(DeployError.Code.DEVICE_ALREADY_DEPLOYED, `Image ${listConfig.name} already deployed`);
|
|
311
310
|
if (!fs.existsSync(listsPath)) return fs.writeFileSync(listsPath, JSON.stringify([listConfig], null, 2));
|
|
312
311
|
const lists = JSON.parse(fs.readFileSync(listsPath, "utf-8")) ?? [];
|
|
313
312
|
if (!Array.isArray(lists)) throw new DeployError(DeployError.Code.LIST_JSON_NOT_AN_ARRAY, "Lists is not an array");
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import progress from "progress-stream";
|
|
|
6
6
|
import unzipper from "unzipper";
|
|
7
7
|
|
|
8
8
|
//#region package.json
|
|
9
|
-
var version = "0.3.
|
|
9
|
+
var version = "0.3.4";
|
|
10
10
|
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/devices/list.ts
|
|
@@ -268,12 +268,11 @@ var DeviceImpl = class {
|
|
|
268
268
|
return `${Object.entries(this.buildDeviceIni()).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => `${key}=${value}`).join("\n")}\n`;
|
|
269
269
|
}
|
|
270
270
|
async deploy() {
|
|
271
|
-
if (await this.isDeployed())
|
|
271
|
+
if (await this.isDeployed()) throw new DeployError(DeployError.Code.DEVICE_ALREADY_DEPLOYED, `Image ${this.options.name} already deployed`);
|
|
272
272
|
const { fs, path, deployedPath } = this.image.getImageManager().getOptions();
|
|
273
273
|
if (!fs.existsSync(deployedPath)) fs.mkdirSync(deployedPath, { recursive: true });
|
|
274
274
|
const listsPath = path.join(deployedPath, "lists.json");
|
|
275
275
|
const listConfig = this.buildList();
|
|
276
|
-
if (fs.existsSync(listConfig.path)) throw new DeployError(DeployError.Code.DEVICE_ALREADY_DEPLOYED, `Image ${listConfig.name} already deployed`);
|
|
277
276
|
if (!fs.existsSync(listsPath)) return fs.writeFileSync(listsPath, JSON.stringify([listConfig], null, 2));
|
|
278
277
|
const lists = JSON.parse(fs.readFileSync(listsPath, "utf-8")) ?? [];
|
|
279
278
|
if (!Array.isArray(lists)) throw new DeployError(DeployError.Code.LIST_JSON_NOT_AN_ARRAY, "Lists is not an array");
|
package/package.json
CHANGED