| pkgs.forEach(async (item, index) => { | pkgs.forEach(async (item, index) => { | ||||
| await fse.exists( | await fse.exists( | ||||
| path.resolve(__dirname, '..', `packages/${item}/dist`), | path.resolve(__dirname, '..', `packages/${item}/dist`), | ||||
| exists => { | |||||
| async exists => { | |||||
| if (exists) { | if (exists) { | ||||
| shell.cd(path.resolve(__dirname, '..', `packages/${item}`)) | shell.cd(path.resolve(__dirname, '..', `packages/${item}`)) | ||||
| try { | try { | ||||
| let code = shell.exec( | |||||
| let code = await shell.exec( | |||||
| `yarn publish --new-version ${version} --access public` | `yarn publish --new-version ${version} --access public` | ||||
| ).code | ).code | ||||
| if (code !== 0) { | if (code !== 0) { |