Skip to content

Commit

Permalink
fix default config
Browse files Browse the repository at this point in the history
  • Loading branch information
fergiemcdowall committed Sep 2, 2024
1 parent 98f9405 commit 6117a52
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion bin/norch
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#!/usr/bin/env node

import path from 'path'
import { Command } from 'commander'
import { Norch } from '../src/Norch.js'
import { fileURLToPath } from 'url'
import { readFileSync } from 'node:fs'

const program = new Command()

const defaultConfigFile = JSON.parse(
readFileSync('./src/defaultConfig.json', 'utf8')
readFileSync(new URL('../defaultConfig.json', import.meta.url))
)

const version = JSON.parse(readFileSync('package.json', 'utf8')).version

program
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion myConf.json

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "norch",
"version": "1.0.0",
"version": "1.0.0-rc1",
"description": "A search engine based on Node.js and LevelDB",
"main": "./src/main",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/Norch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import figlet from 'figlet'
export class Norch {
constructor (ops = {}) {
const defaultConfigFile = JSON.parse(
readFileSync('./src/defaultConfig.json', 'utf8')
readFileSync(new URL('../defaultConfig.json', import.meta.url))
)
const userConfigFile = this.readUserConfigFile(ops.configFile)
this.options = Object.assign(defaultConfigFile, ops, userConfigFile)
Expand Down

0 comments on commit 6117a52

Please sign in to comment.