I have a default path being stored that usings path.join to create the path, when getting the path back from the config, it is not formatted correctly. E.G.
export type Config = {
dataPath: string
campaignsDB: string
port: number
}
const dataPath = getDataDir() // this gives a real path like - 'home/becks/Dev/app/packages/server/data'
const campaignsDB = path.join(dataPath, 'db', 'campaigns.csv')
const conf = new Conf<Config>({
defaults: {
dataPath,
campaignsDB,
port: 3000,
},
configName: 'alis',
})
export const getCampaignsDB = (): string => conf.get('campaignsDB')
console.log(campaignsDB) == 'home/becks/Dev/app/packages/server/data/db/campaigns.csv'
console.log(getCampaignsDB()) == 'home/becks/Dev/app/packages/server/datadb/campaigns.csv' // notice the missing slash !
I'm not sure how or why this is happening, but it took me a good 20 minutes to realize that it was this lib causing the issue. Any ideas on what it might be?
Thanks.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too