@@ -10,7 +10,7 @@ import { Datastore } from "interface-datastore";
1010import { base36 } from "multiformats/bases/base36" ;
1111import { existsSync } from "node:fs" ;
1212import { mkdir } from "node:fs/promises" ;
13- import { join , resolve } from "node:path" ;
13+ import { join } from "node:path" ;
1414import { dirname } from "node:path" ;
1515import { fileURLToPath } from "node:url" ;
1616import { SupportedPrivateKey } from "../challenge.js" ;
@@ -94,16 +94,13 @@ export const setupConfig = async (
9494) : Promise <
9595 { CONFIG_PATH : string ; blockstore : Blockstore ; datastore : Datastore ; }
9696> => {
97- const CONFIG_DIR = resolve ( dir ) ;
98- await mkdir ( CONFIG_DIR , { recursive : true } ) ;
97+ await mkdir ( dir , { recursive : true } ) ;
9998
100- const datastore = new LevelDatastore ( join ( CONFIG_DIR , `${ space } /datastore` ) ) ;
101- const blockstore = new LevelBlockstore (
102- join ( CONFIG_DIR , `${ space } /blockstore` ) ,
103- ) ;
99+ const datastore = new LevelDatastore ( join ( dir , `${ space } /datastore` ) ) ;
100+ const blockstore = new LevelBlockstore ( join ( dir , `${ space } /blockstore` ) ) ;
104101
105102 const DEFAULT_CONFIG_PATH = join ( __dirname , "daemon-config.js" ) ;
106- const CUSTOM_CONFIG_PATH = join ( CONFIG_DIR , `${ space } /config.js` ) ;
103+ const CUSTOM_CONFIG_PATH = join ( dir , `${ space } /config.js` ) ;
107104 const CONFIG_PATH = existsSync ( CUSTOM_CONFIG_PATH )
108105 ? CUSTOM_CONFIG_PATH
109106 : DEFAULT_CONFIG_PATH ;
0 commit comments