Skip to content

Commit

Permalink
add hub param to start command (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoecheza authored Oct 29, 2024
1 parent 8a0f3dc commit 48941ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 10 additions & 5 deletions packages/@dcl/sdk-commands/src/commands/start/explorer-alpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const isWindows = /^win/.test(process.platform)

export async function runExplorerAlpha(
components: CliComponents,
opts: { cwd: string; realm: string; baseCoords: { x: number; y: number } }
opts: { cwd: string; realm: string; baseCoords: { x: number; y: number }; isHub: boolean }
) {
const { cwd, realm, baseCoords } = opts
const { cwd, realm, baseCoords, isHub } = opts

if (await runApp(components, { cwd, realm, baseCoords })) {
if (await runApp(components, { cwd, realm, baseCoords, isHub })) {
return
}

Expand All @@ -17,11 +17,16 @@ export async function runExplorerAlpha(

async function runApp(
components: CliComponents,
{ cwd, realm, baseCoords }: { cwd: string; realm: string; baseCoords: { x: number; y: number } }
{
cwd,
realm,
baseCoords,
isHub
}: { cwd: string; realm: string; baseCoords: { x: number; y: number }; isHub: boolean }
) {
const cmd = isWindows ? 'start' : 'open'
try {
const params = `realm=${realm}&position=${baseCoords.x},${baseCoords.y}&local-scene=true&debug=true`
const params = `realm=${realm}&position=${baseCoords.x},${baseCoords.y}&local-scene=true&debug=true&hub=${isHub}`
const app = `decentraland://"${params}"`
await components.spawner.exec(cwd, cmd, [app], { silent: true })
components.logger.info(`Desktop client: decentraland://${params}\n`)
Expand Down
6 changes: 4 additions & 2 deletions packages/@dcl/sdk-commands/src/commands/start/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const args = declareArgs({
'--skip-build': Boolean,
'--desktop-client': Boolean,
'--data-layer': Boolean,
'--explorer-alpha': Boolean
'--explorer-alpha': Boolean,
'--hub': Boolean
})

export async function help(options: Options) {
Expand Down Expand Up @@ -93,6 +94,7 @@ export async function main(options: Options) {
const withDataLayer = options.args['--data-layer']
const enableWeb3 = options.args['--web3']
const explorerAlpha = options.args['--explorer-alpha']
const isHub = !!options.args['--hub']

let hasSmartWearable = false

Expand Down Expand Up @@ -230,7 +232,7 @@ export async function main(options: Options) {

if (explorerAlpha) {
const realm = new URL(sortedURLs[0]).origin
await runExplorerAlpha(components, { cwd: workingDirectory, realm, baseCoords })
await runExplorerAlpha(components, { cwd: workingDirectory, realm, baseCoords, isHub })
}

// Open preferably localhost/127.0.0.1
Expand Down

0 comments on commit 48941ef

Please sign in to comment.