11import fs from "fs" ;
22import util from "node:util" ;
3- import path from "path" ;
43
54import { DirectoryServiceV3 } from "../lib" ;
65import { log } from "../lib/log" ;
@@ -13,8 +12,7 @@ export const TOPAZ_TIMEOUT =
1312
1413export class Topaz {
1514 async start ( ) {
16- await this . backup ( ) ;
17- await execute ( "topaz templates install todo -f --no-console" ) ;
15+ await execute ( "topaz templates install todo -f --no-console -i" ) ;
1816
1917 const certsDir = await this . caCert ( ) ;
2018
@@ -37,7 +35,6 @@ export class Topaz {
3735
3836 async stop ( ) {
3937 await execute ( "topaz stop" ) ;
40- await this . restore ( ) ;
4138 }
4239
4340 async caCert ( ) {
@@ -57,32 +54,6 @@ export class Topaz {
5754 await execute ( "topaz config info | jq -r '.config.topaz_cfg_dir'" )
5855 ) . replace ( / ( \r \n | \n | \r ) / gm, "" ) } `;
5956 }
60-
61- async backup ( ) {
62- fs . rename (
63- path . join ( await this . dbDir ( ) , "directory.db" ) ,
64- path . join ( await this . dbDir ( ) , "directory.bak" ) ,
65- ( ) => { } ,
66- ) ;
67- fs . rename (
68- path . join ( await this . configDir ( ) , "todo.yaml" ) ,
69- path . join ( await this . configDir ( ) , "todo.bak" ) ,
70- ( ) => { } ,
71- ) ;
72- }
73-
74- async restore ( ) {
75- fs . rename (
76- path . join ( await this . dbDir ( ) , "directory.bak" ) ,
77- path . join ( await this . dbDir ( ) , "directory.db" ) ,
78- ( ) => { } ,
79- ) ;
80- fs . rename (
81- path . join ( await this . configDir ( ) , "todo.bak" ) ,
82- path . join ( await this . configDir ( ) , "todo.yaml" ) ,
83- ( ) => { } ,
84- ) ;
85- }
8657}
8758
8859const retry = async < T > (
0 commit comments