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

chore: Remove notification for some commands #1046

Merged
merged 1 commit into from
Dec 28, 2020
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
4 changes: 1 addition & 3 deletions src/commands/cacert/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ChectlContext } from '../../api/context'
import { KubeHelper } from '../../api/kube'
import { cheNamespace, skipKubeHealthzCheck } from '../../common-flags'
import { DEFAULT_CA_CERT_FILE_NAME } from '../../constants'
import { getCommandErrorMessage, notifyCommandCompletedSuccessfully } from '../../util'
import { getCommandErrorMessage } from '../../util'

export default class Export extends Command {
static description = 'Retrieves Eclipse Che self-signed certificate'
Expand Down Expand Up @@ -61,7 +61,5 @@ export default class Export extends Command {
} catch (err) {
this.error(getCommandErrorMessage(err))
}

notifyCommandCompletedSuccessfully()
}
}
2 changes: 0 additions & 2 deletions src/commands/dashboard/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { cli } from 'cli-ux'
import { CheHelper } from '../../api/che'
import { ChectlContext } from '../../api/context'
import { cheNamespace } from '../../common-flags'
import { notifyCommandCompletedSuccessfully } from '../../util'

export default class Open extends Command {
static description = 'Open Eclipse Che dashboard'
Expand All @@ -39,7 +38,6 @@ export default class Open extends Command {
this.error(error)
}

notifyCommandCompletedSuccessfully()
this.exit(0)
}
}
2 changes: 0 additions & 2 deletions src/commands/devfile/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import * as yaml from 'js-yaml'
import { ChectlContext } from '../../api/context'
import { Devfile, DevfileCommand, DevfileComponent, DevfileProject, ProjectSource, TheEndpointName } from '../../api/devfile'
import { KubeHelper } from '../../api/kube'
import { notifyCommandCompletedSuccessfully } from '../../util'

let kube: KubeHelper
const stringLitArray = <L extends string>(arr: L[]) => arr
Expand Down Expand Up @@ -253,7 +252,6 @@ export default class Generate extends Command {
this.log(`# chectl ${updatedArgs.join(' ')}`)
this.log(yaml.safeDump(devfile))

notifyCommandCompletedSuccessfully()
this.exit(0)
}

Expand Down
4 changes: 1 addition & 3 deletions src/commands/server/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ChectlContext } from '../../api/context'
import { cheNamespace, listrRenderer, skipKubeHealthzCheck } from '../../common-flags'
import { CheTasks } from '../../tasks/che'
import { ApiTasks } from '../../tasks/platforms/api'
import { getCommandErrorMessage, notifyCommandCompletedSuccessfully } from '../../util'
import { getCommandErrorMessage } from '../../util'

export default class Debug extends Command {
static description = 'Enable local debug of Eclipse Che server'
Expand Down Expand Up @@ -51,7 +51,5 @@ export default class Debug extends Command {
} catch (err) {
this.error(getCommandErrorMessage(err))
}

notifyCommandCompletedSuccessfully()
}
}
3 changes: 1 addition & 2 deletions src/commands/server/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ChectlContext } from '../../api/context'
import { cheDeployment, cheNamespace, listrRenderer, skipKubeHealthzCheck } from '../../common-flags'
import { CheTasks } from '../../tasks/che'
import { ApiTasks } from '../../tasks/platforms/api'
import { getCommandErrorMessage, getCommandSuccessMessage, notifyCommandCompletedSuccessfully } from '../../util'
import { getCommandErrorMessage, getCommandSuccessMessage } from '../../util'

export default class Logs extends Command {
static description = 'Collect Eclipse Che logs'
Expand Down Expand Up @@ -54,7 +54,6 @@ export default class Logs extends Command {
this.error(getCommandErrorMessage(err))
}

notifyCommandCompletedSuccessfully()
this.exit(0)
}
}
2 changes: 0 additions & 2 deletions src/commands/server/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { ChectlContext } from '../../api/context'
import { KubeHelper } from '../../api/kube'
import { VersionHelper } from '../../api/version'
import { cheNamespace } from '../../common-flags'
import { notifyCommandCompletedSuccessfully } from '../../util'

export default class Status extends Command {
// Implementation-Version it is a property from Manifest.ml inside of che server pod which indicate Eclipse Che build version.
Expand Down Expand Up @@ -47,6 +46,5 @@ export default class Status extends Command {
cli.log(`Eclipse Che Url : ${await che.cheURL(flags.chenamespace)}`)
cli.log(`OpenShift OAuth enabled: ${openshiftOauth}\n`)

notifyCommandCompletedSuccessfully()
}
}
2 changes: 0 additions & 2 deletions src/commands/workspace/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { CheApiClient } from '../../api/che-api-client'
import { getLoginData } from '../../api/che-login-manager'
import { ChectlContext } from '../../api/context'
import { accessToken, ACCESS_TOKEN_KEY, cheApiEndpoint, cheNamespace, CHE_API_ENDPOINT_KEY, skipKubeHealthzCheck } from '../../common-flags'
import { notifyCommandCompletedSuccessfully } from '../../util'

export default class Create extends Command {
static description = 'Creates a workspace from a devfile'
Expand Down Expand Up @@ -77,7 +76,6 @@ export default class Create extends Command {
cli.url(workspaceIdeURL, workspaceIdeURL)
}

notifyCommandCompletedSuccessfully()
this.exit(0)
}

Expand Down
2 changes: 0 additions & 2 deletions src/commands/workspace/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { getLoginData } from '../../api/che-login-manager'
import { ChectlContext } from '../../api/context'
import { KubeHelper } from '../../api/kube'
import { accessToken, ACCESS_TOKEN_KEY, cheApiEndpoint, cheNamespace, CHE_API_ENDPOINT_KEY, skipKubeHealthzCheck } from '../../common-flags'
import { notifyCommandCompletedSuccessfully } from '../../util'

export default class Delete extends Command {
static description = 'Delete a stopped workspace - use workspace:stop to stop the workspace before deleting it'
Expand Down Expand Up @@ -71,7 +70,6 @@ export default class Delete extends Command {
}
}

notifyCommandCompletedSuccessfully()
this.exit(0)
}
}
4 changes: 1 addition & 3 deletions src/commands/workspace/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { getLoginData } from '../../api/che-login-manager'
import { ChectlContext } from '../../api/context'
import { KubeHelper } from '../../api/kube'
import { accessToken, ACCESS_TOKEN_KEY, cheApiEndpoint, cheNamespace, CHE_API_ENDPOINT_KEY, skipKubeHealthzCheck } from '../../common-flags'
import { getClusterClientCommand, getCommandErrorMessage, notifyCommandCompletedSuccessfully, OPENSHIFT_CLI } from '../../util'
import { getClusterClientCommand, getCommandErrorMessage, OPENSHIFT_CLI } from '../../util'

export default class Inject extends Command {
static description = 'Inject configurations and tokens in a workspace'
Expand Down Expand Up @@ -98,8 +98,6 @@ export default class Inject extends Command {
} catch (err) {
this.error(getCommandErrorMessage(err))
}

notifyCommandCompletedSuccessfully()
}

async injectKubeconfig(flags: any, workspaceNamespace: string, workspacePodName: string, workspaceId: string): Promise<void> {
Expand Down
2 changes: 0 additions & 2 deletions src/commands/workspace/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { CheApiClient } from '../../api/che-api-client'
import { getLoginData } from '../../api/che-login-manager'
import { ChectlContext } from '../../api/context'
import { accessToken, ACCESS_TOKEN_KEY, cheApiEndpoint, cheNamespace, CHE_API_ENDPOINT_KEY, skipKubeHealthzCheck } from '../../common-flags'
import { notifyCommandCompletedSuccessfully } from '../../util'

export default class List extends Command {
static description = 'List workspaces'
Expand All @@ -37,7 +36,6 @@ export default class List extends Command {
const workspaces = await cheApiClient.getAllWorkspaces(accessToken)

this.printWorkspaces(workspaces)
notifyCommandCompletedSuccessfully()
}

private printWorkspaces(workspaces: any[]): void {
Expand Down
3 changes: 0 additions & 3 deletions src/commands/workspace/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import * as path from 'path'
import { CheHelper } from '../../api/che'
import { ChectlContext } from '../../api/context'
import { skipKubeHealthzCheck } from '../../common-flags'
import { notifyCommandCompletedSuccessfully } from '../../util'

export default class Logs extends Command {
static description = 'Collect workspace(s) logs'
Expand Down Expand Up @@ -61,7 +60,5 @@ export default class Logs extends Command {
} catch (error) {
this.error(error)
}

notifyCommandCompletedSuccessfully()
}
}
2 changes: 0 additions & 2 deletions src/commands/workspace/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { CheApiClient } from '../../api/che-api-client'
import { getLoginData } from '../../api/che-login-manager'
import { ChectlContext } from '../../api/context'
import { accessToken, ACCESS_TOKEN_KEY, cheApiEndpoint, cheNamespace, CHE_API_ENDPOINT_KEY, skipKubeHealthzCheck } from '../../common-flags'
import { notifyCommandCompletedSuccessfully } from '../../util'

export default class Start extends Command {
static description = 'Starts a workspace'
Expand Down Expand Up @@ -62,7 +61,6 @@ export default class Start extends Command {
cli.log('Workspace start request has been sent, workspace will be available shortly.')
}

notifyCommandCompletedSuccessfully()
this.exit(0)
}
}
2 changes: 0 additions & 2 deletions src/commands/workspace/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { CheApiClient } from '../../api/che-api-client'
import { getLoginData } from '../../api/che-login-manager'
import { ChectlContext } from '../../api/context'
import { accessToken, ACCESS_TOKEN_KEY, cheApiEndpoint, cheNamespace, CHE_API_ENDPOINT_KEY, skipKubeHealthzCheck } from '../../common-flags'
import { notifyCommandCompletedSuccessfully } from '../../util'

export default class Stop extends Command {
static description = 'Stop a running workspace'
Expand Down Expand Up @@ -47,7 +46,6 @@ export default class Stop extends Command {
await cheApiClient.stopWorkspace(workspaceId, accessToken)
cli.log(`Workspace ${workspaceId} successfully stopped.`)

notifyCommandCompletedSuccessfully()
this.exit(0)
}
}