diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index cea3af43..de4cc72f 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -78,9 +78,10 @@ jobs: - name: Is A Publish Branch if: steps.check-branch.outputs.match == 'true' run: | + NAME=$(npx pkg-jq -r .name) VERSION=$(npx pkg-jq -r .version) - if npx version-exists @chatie/grpc "$VERSION" - then "Version $VERSION exists on NPM, skipped." + if npx version-exists "$NAME" "$VERSION" + then echo "$NAME@$VERSION exists on NPM, skipped." else npm publish fi env: diff --git a/package.json b/package.json index e129d873..c8b8ce86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wechaty-puppet", - "version": "0.21.11", + "version": "0.21.12", "description": "Abstract Puppet for Wechaty", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", diff --git a/src/puppet.ts b/src/puppet.ts index 83e7f359..60771861 100644 --- a/src/puppet.ts +++ b/src/puppet.ts @@ -453,15 +453,12 @@ export abstract class Puppet extends EventEmitter { */ public abstract async logout (): Promise - public selfId (): undefined | string { + public selfId (): string { log.verbose('Puppet', 'selfId()') - /** - * Huan (202003): do not throw exception. deal `undefined` outside. - */ - // if (!this.id) { - // throw new Error('not logged in, no this.id yet.') - // } + if (!this.id) { + throw new Error('not logged in, no this.id yet.') + } return this.id }