Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch to prevent long running commands to call onFinishCommand hook #1032

Merged
merged 1 commit into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion packages/aragon-cli/src/commands/devchain_cmds/start.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
const { start } = require('@aragon/aragen').commands

Object.assign(exports, start)
// Using verbose approach for transparency, instead of `Object.assign(exports, start)`
exports.command = start.command
exports.describe = start.describe
exports.builder = start.builder
exports.task = start.task
exports.printAccounts = start.printAccounts
exports.printMnemonic = start.printMnemonic
exports.printResetNotice = start.printResetNotice
exports.handler = async args => {
await start.handler(args)

// Patch to prevent calling the onFinishCommand hook
await new Promise((resolve, reject) => {})
}
3 changes: 3 additions & 0 deletions packages/aragon-cli/src/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,5 +442,8 @@ exports.handler = async function({
} else if (!manifest.start_url) {
reporter.warning('No front-end detected (no start_url defined)')
}

// Patch to prevent calling the onFinishCommand hook
await new Promise((resolve, reject) => {})
})
}
20 changes: 11 additions & 9 deletions packages/aragon-cli/src/commands/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ exports.handler = async ({
clientPort,
clientPath,
})
return task
.run()
.then(() =>
reporter.info(
`Aragon client from ${blue(clientRepo)} version ${blue(
clientVersion
)} started on port ${blue(clientPort)}`
)
)

await task.run()

reporter.info(
`Aragon client from ${blue(clientRepo)} version ${blue(
clientVersion
)} started on port ${blue(clientPort)}`
)

// Patch to prevent calling the onFinishCommand hook
await new Promise((resolve, reject) => {})
}