Skip to content

Commit

Permalink
feat: add garden get doddi command
Browse files Browse the repository at this point in the history
In celebration of #2000!
  • Loading branch information
edvald committed Aug 13, 2020
1 parent 8dd0874 commit 9d1a618
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 16 deletions.
41 changes: 41 additions & 0 deletions core/src/commands/get/get-doddi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2018-2020 Garden Technologies, Inc. <[email protected]>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { Command, CommandResult } from "../base"
import dedent = require("dedent")
import { readFile } from "fs-extra"
import { STATIC_DIR } from "../../constants"
import { join } from "path"
import { exec } from "../../util/util"

export class GetDoddiCommand extends Command {
name = "doddi"
help = "Meet our VP of Engineering."

description = dedent`
He's nice. We promise. Don't be afraid.
`

loggerType: "basic"

hidden = true
noProject = true

async action(): Promise<CommandResult> {
const image = (await readFile(join(STATIC_DIR, "doddi.txt"))).toString()
// tslint:disable-next-line: no-console
console.log(image)

try {
// Close enough.
await exec("say", ["-v", "Daniel", "Hello. My name is dawddeeh."])
} catch (_) {}

return { result: { image } }
}
}
3 changes: 3 additions & 0 deletions core/src/commands/get/get-eysi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export class GetEysiCommand extends Command {

loggerType: "basic"

hidden = true
noProject = true

async action(): Promise<CommandResult> {
const eysi = (await readFile(join(STATIC_DIR, "eysi.txt"))).toString()
// tslint:disable-next-line: no-console
Expand Down
2 changes: 2 additions & 0 deletions core/src/commands/get/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { GetTestResultCommand } from "./get-test-result"
import { GetDebugInfoCommand } from "./get-debug-info"
import { GetLinkedReposCommand } from "./get-linked-repos"
import { GetOutputsCommand } from "./get-outputs"
import { GetDoddiCommand } from "./get-doddi"

export class GetCommand extends CommandGroup {
name = "get"
Expand All @@ -26,6 +27,7 @@ export class GetCommand extends CommandGroup {
subCommands = [
GetGraphCommand,
GetConfigCommand,
GetDoddiCommand,
GetEysiCommand,
GetLinkedReposCommand,
GetOutputsCommand,
Expand Down
Loading

0 comments on commit 9d1a618

Please sign in to comment.