Skip to content

Commit 6117a52

Browse files
fix default config
1 parent 98f9405 commit 6117a52

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

bin/norch

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
#!/usr/bin/env node
22

3+
import path from 'path'
34
import { Command } from 'commander'
45
import { Norch } from '../src/Norch.js'
6+
import { fileURLToPath } from 'url'
57
import { readFileSync } from 'node:fs'
68

79
const program = new Command()
810

911
const defaultConfigFile = JSON.parse(
10-
readFileSync('./src/defaultConfig.json', 'utf8')
12+
readFileSync(new URL('../defaultConfig.json', import.meta.url))
1113
)
14+
1215
const version = JSON.parse(readFileSync('package.json', 'utf8')).version
1316

1417
program
File renamed without changes.

myConf.json

-1
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "norch",
3-
"version": "1.0.0",
3+
"version": "1.0.0-rc1",
44
"description": "A search engine based on Node.js and LevelDB",
55
"main": "./src/main",
66
"dependencies": {

src/Norch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import figlet from 'figlet'
1212
export class Norch {
1313
constructor (ops = {}) {
1414
const defaultConfigFile = JSON.parse(
15-
readFileSync('./src/defaultConfig.json', 'utf8')
15+
readFileSync(new URL('../defaultConfig.json', import.meta.url))
1616
)
1717
const userConfigFile = this.readUserConfigFile(ops.configFile)
1818
this.options = Object.assign(defaultConfigFile, ops, userConfigFile)

0 commit comments

Comments
 (0)