codify-plugin-lib 1.0.120 → 1.0.122
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/plugin/plugin.js
CHANGED
|
@@ -101,7 +101,7 @@ export class Plugin {
|
|
|
101
101
|
// Validate using desired/desired. If the apply was successful, no changes should be reported back.
|
|
102
102
|
// Default back desired back to current if it is not defined (for destroys only)
|
|
103
103
|
const validationPlan = await ptyLocalStorage.run(new BackgroundPty(), async () => {
|
|
104
|
-
const result = await resource.plan(plan.desiredConfig ?? plan.currentConfig, plan.
|
|
104
|
+
const result = await resource.plan(plan.desiredConfig, plan.desiredConfig ?? plan.currentConfig, plan.statefulMode);
|
|
105
105
|
await getPty().kill();
|
|
106
106
|
return result;
|
|
107
107
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import pty from '@homebridge/node-pty-prebuilt-multiarch';
|
|
1
2
|
import { nanoid } from 'nanoid';
|
|
2
3
|
import * as cp from 'node:child_process';
|
|
3
4
|
import { EventEmitter } from 'node:events';
|
|
4
5
|
import * as fs from 'node:fs/promises';
|
|
5
|
-
import pty from 'node-pty';
|
|
6
6
|
import stripAnsi from 'strip-ansi';
|
|
7
7
|
import { debugLog } from '../utils/debug.js';
|
|
8
8
|
import { SpawnError } from './index.js';
|
|
@@ -63,9 +63,6 @@ export class BackgroundPty {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
cat.on('close', () => {
|
|
67
|
-
console.log('close');
|
|
68
|
-
});
|
|
69
66
|
this.promiseQueue.run(async () => new Promise((resolve) => {
|
|
70
67
|
const cdCommand = options?.cwd ? `cd ${options.cwd}; ` : '';
|
|
71
68
|
// Redirecting everything to the pipe and running in theb background avoids most if not all back-pressure problems
|
|
@@ -84,8 +81,6 @@ export class BackgroundPty {
|
|
|
84
81
|
this.basePty.write(`${command}\r`);
|
|
85
82
|
}));
|
|
86
83
|
}).finally(async () => {
|
|
87
|
-
// console.log('finally');
|
|
88
|
-
// await fileHandle?.close();
|
|
89
84
|
await fs.rm(`/tmp/${cid}`);
|
|
90
85
|
});
|
|
91
86
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codify-plugin-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.122",
|
|
4
4
|
"description": "Library plugin library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"uuid": "^10.0.0",
|
|
20
20
|
"lodash.isequal": "^4.5.0",
|
|
21
21
|
"nanoid": "^5.0.9",
|
|
22
|
-
"node-pty": "^
|
|
22
|
+
"@homebridge/node-pty-prebuilt-multiarch": "^0.12.0-beta.5",
|
|
23
23
|
"strip-ansi": "^7.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
package/src/plugin/plugin.ts
CHANGED
|
@@ -155,8 +155,8 @@ export class Plugin {
|
|
|
155
155
|
// Default back desired back to current if it is not defined (for destroys only)
|
|
156
156
|
const validationPlan = await ptyLocalStorage.run(new BackgroundPty(), async () => {
|
|
157
157
|
const result = await resource.plan(
|
|
158
|
-
plan.desiredConfig ?? plan.currentConfig,
|
|
159
158
|
plan.desiredConfig,
|
|
159
|
+
plan.desiredConfig ?? plan.currentConfig,
|
|
160
160
|
plan.statefulMode
|
|
161
161
|
);
|
|
162
162
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import pty from '@homebridge/node-pty-prebuilt-multiarch';
|
|
1
2
|
import { nanoid } from 'nanoid';
|
|
2
3
|
import * as cp from 'node:child_process';
|
|
3
4
|
import { EventEmitter } from 'node:events';
|
|
4
5
|
import * as fs from 'node:fs/promises';
|
|
5
|
-
import pty from 'node-pty';
|
|
6
6
|
import stripAnsi from 'strip-ansi';
|
|
7
7
|
|
|
8
8
|
import { debugLog } from '../utils/debug.js';
|
|
@@ -79,10 +79,6 @@ export class BackgroundPty implements IPty {
|
|
|
79
79
|
}
|
|
80
80
|
})
|
|
81
81
|
|
|
82
|
-
cat.on('close', () => {
|
|
83
|
-
console.log('close');
|
|
84
|
-
})
|
|
85
|
-
|
|
86
82
|
this.promiseQueue.run(async () => new Promise((resolve) => {
|
|
87
83
|
const cdCommand = options?.cwd ? `cd ${options.cwd}; ` : '';
|
|
88
84
|
// Redirecting everything to the pipe and running in theb background avoids most if not all back-pressure problems
|
|
@@ -105,8 +101,6 @@ export class BackgroundPty implements IPty {
|
|
|
105
101
|
|
|
106
102
|
}));
|
|
107
103
|
}).finally(async () => {
|
|
108
|
-
// console.log('finally');
|
|
109
|
-
// await fileHandle?.close();
|
|
110
104
|
await fs.rm(`/tmp/${cid}`);
|
|
111
105
|
})
|
|
112
106
|
}
|