mirror of
https://github.com/Retropex/mempool-startos.git
synced 2025-05-16 13:10:46 +02:00
33 lines
721 B
TypeScript
33 lines
721 B
TypeScript
import { matches, types as T, YAML } from "../deps.ts";
|
|
|
|
const { shape, boolean } = matches;
|
|
|
|
const matchElectrs = shape({
|
|
"enable-electrs ": boolean,
|
|
}, ["enable-electrs "]);
|
|
|
|
export const migration_down_2_3_1_4: T.ExpectedExports.migration = async (
|
|
effects,
|
|
_version,
|
|
) => {
|
|
|
|
try {
|
|
await effects.createDir({
|
|
volumeId: "main",
|
|
path: "start9",
|
|
});
|
|
const config = await effects.readFile({
|
|
volumeId: "main",
|
|
path: "start9/config.yaml",
|
|
});
|
|
const parsed = YAML.parse(config);
|
|
|
|
if (matchElectrs.test(parsed)) {
|
|
delete parsed["enable-electrs "];
|
|
}
|
|
return { result: { configured: true } };
|
|
} catch {
|
|
return { result: { configured: true } };
|
|
}
|
|
};
|