@extrahorizon/exh-cli 1.13.0-dev-172-a913253 → 1.13.0-dev-173-4c24837

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.
@@ -1,5 +1,14 @@
1
1
  import { Argv } from 'yargs';
2
2
  export declare const command = "sync";
3
3
  export declare const desc = "Synchronize Service Settings";
4
- export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, never> & import("yargs").InferredOptionTypes<{}>>;
5
- export declare const handler: () => Promise<void>;
4
+ export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "file"> & import("yargs").InferredOptionTypes<{
5
+ file: {
6
+ demandOption: false;
7
+ describe: string;
8
+ type: "string";
9
+ default: string;
10
+ };
11
+ }>>;
12
+ export declare const handler: ({ file }: {
13
+ file: string;
14
+ }) => Promise<void>;
@@ -1,15 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handler = exports.builder = exports.desc = exports.command = void 0;
4
- const path = require("node:path");
5
4
  const util_1 = require("../../helpers/util");
6
5
  const serviceSettingService = require("../../services/settings");
7
6
  exports.command = 'sync';
8
7
  exports.desc = 'Synchronize Service Settings';
9
- const builder = (yargs) => (0, util_1.epilogue)(yargs).options({});
8
+ const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
9
+ file: {
10
+ demandOption: false,
11
+ describe: 'Path to the file containing the Service Settings configuration',
12
+ type: 'string',
13
+ default: './service-settings.json',
14
+ },
15
+ });
10
16
  exports.builder = builder;
11
- const handler = async () => {
12
- const filePath = path.join(process.cwd(), 'service-settings.json');
13
- await serviceSettingService.sync(filePath);
17
+ const handler = async ({ file }) => {
18
+ await serviceSettingService.sync(file);
14
19
  };
15
20
  exports.handler = handler;
@@ -15,7 +15,7 @@ async function sync(path) {
15
15
  }
16
16
  exports.sync = sync;
17
17
  async function syncUserSettings(userServiceSettings) {
18
- if (!userServiceSettings) {
18
+ if (!userServiceSettings || Object.keys(userServiceSettings).length === 0) {
19
19
  return;
20
20
  }
21
21
  console.group((0, chalk_1.blue)('Syncing user service settings:'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/exh-cli",
3
- "version": "1.13.0-dev-172-a913253",
3
+ "version": "1.13.0-dev-173-4c24837",
4
4
  "main": "build/index.js",
5
5
  "exports": "./build/index.js",
6
6
  "license": "MIT",