Skip to content

Commit

Permalink
Fix/publish (Postcatlab#253)
Browse files Browse the repository at this point in the history
* fix: can not require global module
  • Loading branch information
buqiyuan committed Mar 6, 2023
1 parent 7832723 commit be5c25e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion scripts/publish.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down

0 comments on commit be5c25e

Please sign in to comment.