Skip to content

Commit

Permalink
Fix to pnpm deploy:walrus script
Browse files Browse the repository at this point in the history
  • Loading branch information
mario4tier committed Aug 27, 2024
1 parent 13e4669 commit f662043
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const main = async () => {
// then publish the site to Walrus Sites.
if (siteObjectId == null) {
console.log('Publishing the app to Walrus Sites...')
const { stdout, stderr } = await exec(
`site-builder --config ${walrusConfigPathFull} --wallet ${WALLET_CONFIG_PATH_FULL} publish ${sitePathFull}`
)
const exec_command = `site-builder --config ${walrusConfigPathFull} --wallet ${WALLET_CONFIG_PATH_FULL} publish ${sitePathFull}`
console.log(`exec: ${exec_command}`)
const { stdout, stderr } = await exec(exec_command)

// Get the site object ID from the publish command output.
stdout.on('data', async (data) => {
Expand All @@ -61,14 +61,20 @@ const main = async () => {

stderr.on('data', async (error) => {
console.error(error)
// Do not exit if the line starts with "[warn]"
if (error.startsWith('[warn]')) {
return
}
process.exit()
})

return
}

if (siteObjectId == null) {
console.error('~ The script could not find the site object ID in the output.')
console.error(
'~ The script could not find the site object ID in the output.'
)
console.error(
'~ If you see it, please add WALRUS_SITE_OBJECT_ID=[site object ID from the output] into packages/frontend/.env.local manually.'
)
Expand Down

0 comments on commit f662043

Please sign in to comment.