Fix/publish (#253)

* fix: can not require global module
This commit is contained in:
bqy_fe 2023-03-06 19:08:24 +08:00 committed by GitHub
parent 783272327d
commit be5c25eada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -29,5 +29,5 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
npm i -g qiniu@6.x
echo "${{ secrets.QINIU_ENV_JS }}" > qiniu_env.js
echo "${{ secrets.QINIU_ENV_JS }}" > ./scripts/qiniu_env.js
node scripts/publish.js

View File

@ -1,4 +1,8 @@
const qiniu = require('qiniu');
const { execSync } = require('child_process');
// get root folder of global node modules
const root = execSync('npm root -g').toString().trim();
const qiniu = require(`${root}/qiniu`);
const package = require('../package.json');
const { AK, SK, bucket } = require('./qiniu_env.js');