-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2a95b5
commit 18b9082
Showing
5 changed files
with
38 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {Hook} from '@oclif/core' | ||
|
||
const hook: Hook<'init'> = async function (opts) { | ||
process.stdout.write(`example hook running ${opts.id}\n`) | ||
} | ||
|
||
export default hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import Hello from './commands/hello' | ||
import HelloWorld from './commands/hello/world' | ||
export {default as INIT_HOOK} from './hooks/init/init' | ||
|
||
export const COMMANDS = { | ||
hello: Hello, | ||
'hello:alias': HelloWorld, | ||
'hello:world': HelloWorld, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {expect, test} from '@oclif/test' | ||
|
||
describe('hooks', () => { | ||
test | ||
.stdout() | ||
.hook('init', {id: 'mycommand'}) | ||
.do(output => expect(output.stdout).to.contain('example hook running mycommand')) | ||
.it('shows a message') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1251,10 +1251,10 @@ | |
read-package-json-fast "^3.0.0" | ||
which "^4.0.0" | ||
|
||
"@oclif/[email protected].1": | ||
version "3.19.2-qa.1" | ||
resolved "http://localhost:4873/@oclif/core/-/core-3.19.2-qa.1.tgz#dec424bccda87253f43396892c26c190a38b2a98" | ||
integrity sha512-91hyRj0/wkEJd8gZddypD/dXKD9WdmEd83B0wpoL8iDefP05GBzO1L6YdJoE6FmUSzjrUp1khI/ZUiw5x/E2tw== | ||
"@oclif/[email protected].2": | ||
version "3.19.2-qa.2" | ||
resolved "http://localhost:4873/@oclif/core/-/core-3.19.2-qa.2.tgz#b228dd9494aed7ac53b33f1e9173e4db16237bb6" | ||
integrity sha512-Ect2uhoTpZ3Vx8lDPrPoda4gSKWzftQaTkct6vk+OQSYeWtjhELqKflRu4lUXU1a9r9E0Hb3ay9Zv28sSgKHaA== | ||
dependencies: | ||
"@types/cli-progress" "^3.11.5" | ||
ansi-escapes "^4.3.2" | ||
|