mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
chore(pockethost): add env-paths support
This commit is contained in:
parent
34acdf1e2c
commit
81e89bbdc8
@ -60,6 +60,7 @@
|
||||
"devcert": "^1.2.2",
|
||||
"dockerode": "^3.3.5",
|
||||
"dotenv": "^16.3.1",
|
||||
"env-paths": "^3.0.0",
|
||||
"event-source-polyfill": "^1.0.31",
|
||||
"eventsource": "^2.0.2",
|
||||
"exit-hook": "^4.0.0",
|
||||
|
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@ -53,6 +53,9 @@ importers:
|
||||
dotenv:
|
||||
specifier: ^16.3.1
|
||||
version: 16.3.1
|
||||
env-paths:
|
||||
specifier: ^3.0.0
|
||||
version: 3.0.0
|
||||
event-source-polyfill:
|
||||
specifier: ^1.0.31
|
||||
version: 1.0.31
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
import { forEach } from '@s-libs/micro-dash'
|
||||
import devcert from 'devcert'
|
||||
import dotenv from 'dotenv'
|
||||
import envPaths from 'env-paths'
|
||||
import { findUpSync } from 'find-up'
|
||||
import { mkdirSync, realpathSync, writeFileSync } from 'fs'
|
||||
import { dirname, join, resolve } from 'path'
|
||||
@ -26,8 +27,7 @@ dotenv.config({ path: `.env` })
|
||||
|
||||
const realScriptPath = realpathSync(process.argv[1]!)
|
||||
|
||||
export const _PH_HOME =
|
||||
process.env.PH_HOME || join(process.env.HOME || resolve(`~`), `.pockethost`)
|
||||
export const _PH_HOME = process.env.PH_HOME || envPaths(`pockethost`).data
|
||||
|
||||
export const _SSL_HOME = join(_PH_HOME, `ssl`)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user