@codifycli/plugin-core 1.1.0-beta11 → 1.1.0-beta13

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.
@@ -30,6 +30,7 @@ export interface SpawnOptions {
30
30
  env?: Record<string, unknown>;
31
31
  interactive?: boolean;
32
32
  requiresRoot?: boolean;
33
+ requiresSudoAskpass?: boolean;
33
34
  stdin?: boolean;
34
35
  disableWrapping?: boolean;
35
36
  }
@@ -32,7 +32,7 @@ export class SequentialPty {
32
32
  throw new Error('Do not directly use sudo. Use the option { requiresRoot: true } instead');
33
33
  }
34
34
  // If sudo is required, we must delegate to the main codify process.
35
- if (options?.stdin || options?.requiresRoot) {
35
+ if (options?.stdin || options?.requiresRoot || options?.requiresSudoAskpass) {
36
36
  return this.externalSpawn(cmd, options);
37
37
  }
38
38
  console.log(`Running command: ${Array.isArray(cmd) ? cmd.join('\\\n') : cmd}` + (options?.cwd ? `(${options?.cwd})` : ''));
@@ -6,9 +6,10 @@ export function splitUserConfig(config) {
6
6
  ...(config.name ? { name: config.name } : {}),
7
7
  ...(config.dependsOn ? { dependsOn: config.dependsOn } : {}),
8
8
  ...(config.os ? { os: config.os } : {}),
9
+ ...(config.distro ? { distro: config.distro } : {})
9
10
  };
10
11
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
- const { type, name, dependsOn, os, ...parameters } = config;
12
+ const { type, name, dependsOn, os, distro, ...parameters } = config;
12
13
  return {
13
14
  parameters: parameters,
14
15
  coreParameters,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codifycli/plugin-core",
3
- "version": "1.1.0-beta11",
3
+ "version": "1.1.0-beta13",
4
4
  "description": "TypeScript library for building Codify plugins to manage system resources (applications, CLI tools, settings) through infrastructure-as-code",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
package/src/pty/index.ts CHANGED
@@ -34,6 +34,7 @@ export interface SpawnOptions {
34
34
  env?: Record<string, unknown>;
35
35
  interactive?: boolean;
36
36
  requiresRoot?: boolean;
37
+ requiresSudoAskpass?: boolean;
37
38
  stdin?: boolean;
38
39
  disableWrapping?: boolean;
39
40
  }
@@ -46,7 +46,7 @@ export class SequentialPty implements IPty {
46
46
  }
47
47
 
48
48
  // If sudo is required, we must delegate to the main codify process.
49
- if (options?.stdin || options?.requiresRoot) {
49
+ if (options?.stdin || options?.requiresRoot || options?.requiresSudoAskpass) {
50
50
  return this.externalSpawn(cmd, options);
51
51
  }
52
52
 
@@ -10,10 +10,11 @@ export function splitUserConfig<T extends StringIndexedObject>(
10
10
  ...(config.name ? { name: config.name } : {}),
11
11
  ...(config.dependsOn ? { dependsOn: config.dependsOn } : {}),
12
12
  ...(config.os ? { os: config.os } : {}),
13
+ ...(config.distro ? { distro: config.distro } : {})
13
14
  };
14
15
 
15
16
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
- const { type, name, dependsOn, os, ...parameters } = config;
17
+ const { type, name, dependsOn, os, distro, ...parameters } = config;
17
18
 
18
19
  return {
19
20
  parameters: parameters as T,
@@ -9,6 +9,7 @@ describe('Utils tests', () => {
9
9
  name: 'name',
10
10
  dependsOn: ['a', 'b', 'c'],
11
11
  os: ['linux'],
12
+ distro: ['debian-based'],
12
13
  propA: 'propA',
13
14
  propB: 'propB',
14
15
  propC: 'propC',