mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-12 16:22:30 +02:00
feat: orchestration harness, selective install, observer improvements
This commit is contained in:
parent
424f3b3729
commit
4e028bd2d2
76 changed files with 11050 additions and 340 deletions
23
scripts/lib/install/apply.js
Normal file
23
scripts/lib/install/apply.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const { writeInstallState } = require('../install-state');
|
||||
|
||||
function applyInstallPlan(plan) {
|
||||
for (const operation of plan.operations) {
|
||||
fs.mkdirSync(require('path').dirname(operation.destinationPath), { recursive: true });
|
||||
fs.copyFileSync(operation.sourcePath, operation.destinationPath);
|
||||
}
|
||||
|
||||
writeInstallState(plan.installStatePath, plan.statePreview);
|
||||
|
||||
return {
|
||||
...plan,
|
||||
applied: true,
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
applyInstallPlan,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue