Skip to content

Commit

Permalink
fix(android): use ios assets
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqingchen committed Nov 13, 2021
1 parent 52a4cc8 commit 8c4f53f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function run(): Promise<void> {
bundlePath: androidBundlePath,
qrPath: androidQrPath,
assetsDest: androidAssetsDest,
publicPath: `${publicPathPerfix}${androidAssetsDest}`
publicPath: `${publicPathPerfix}${iosAssetsDest}` // use ios assets directly
})

// 4. run build bundle
Expand All @@ -68,7 +68,13 @@ export async function run(): Promise<void> {
const {platform, bundlePath, qrPath, assetsDest, publicPath} = bundle
const sourcemapparms = getSourceMapParams(platform)
await exec.exec(`yarn build:rn --reset-cache --platform ${platform} --bundle-output ${bundlePath} --assets-dest ${assetsDest} --publicPath ${publicPath} ${sourcemapparms}`)
await exec.exec(`cp -rf ${assetsDest}${publicPath}/ ${assetsDest}`)
if (platform === 'ios') {
await exec.exec(`ls ./${assetsDest}${publicPath}/`)
await exec.exec(`ls ${assetsDest}${publicPath}/`)
await exec.exec(`ls \`pwd\`/${assetsDest}${publicPath}/`)
await exec.exec(`mv -f \`pwd\`/${assetsDest}${publicPath}/* ${assetsDest}`)
await exec.exec(`mv -f ${assetsDest}${publicPath}/* ${assetsDest}`)
}
const bundleUrl = `${prefix}${bundlePath}`
core.info(`bundle url: ${bundleUrl}`)
const qrText = `taro://releases?platform=${platform}&url=${encodeURIComponent(bundleUrl)}&name=${encodeURIComponent(appName)}&logo=${encodeURIComponent(logo)}`
Expand Down

0 comments on commit 8c4f53f

Please sign in to comment.