Skip to content

Commit

Permalink
fix: env 读取逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
ATQQ committed Jan 21, 2024
1 parent 8134d79 commit b90aec3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/cli/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import qiniu from 'qiniu'
import dotenv from 'dotenv'
import ncp from 'copy-paste'

dotenv.config()

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
dotenv.config({ path: path.join(__dirname, '.env.local') })
dotenv.config({ path: path.join(__dirname, '.env') })
// 七牛账号下的一对有效的Access Key和Secret Key
// 对象存储空间名称 bucket
const accessKey = process.env.QINIU_ACCESS_KEY
Expand Down Expand Up @@ -47,6 +49,4 @@ if (!process.env.CI) {
})
}

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
fs.writeFileSync(path.join(__dirname, '../client/.env.local'), `VITE_APP_QINIU_TOKEN=${envToken}`)

0 comments on commit b90aec3

Please sign in to comment.