Skip to content

Commit be5c25e

Browse files
authored
Fix/publish (Postcatlab#253)
* fix: can not require global module
1 parent 7832723 commit be5c25e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ jobs:
2929
if: matrix.os == 'ubuntu-latest'
3030
run: |
3131
32-
echo "${{ secrets.QINIU_ENV_JS }}" > qiniu_env.js
32+
echo "${{ secrets.QINIU_ENV_JS }}" > ./scripts/qiniu_env.js
3333
node scripts/publish.js

scripts/publish.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
const qiniu = require('qiniu');
1+
const { execSync } = require('child_process');
2+
// get root folder of global node modules
3+
const root = execSync('npm root -g').toString().trim();
4+
5+
const qiniu = require(`${root}/qiniu`);
26
const package = require('../package.json');
37
const { AK, SK, bucket } = require('./qiniu_env.js');
48

0 commit comments

Comments
 (0)