Skip to content

Commit 9ffd1e6

Browse files
changed output to be project.title instead of name (#201)
* changed output to be project.title instead of name
1 parent 2801684 commit 9ffd1e6

8 files changed

Lines changed: 23 additions & 23 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"repository": "adobe/aio-cli-plugin-console",
7070
"scripts": {
7171
"eslint": "eslint src test e2e",
72-
"test": "npm run eslint && npm run unit-tests",
72+
"test": "npm run unit-tests && npm run eslint",
7373
"unit-tests": "jest --ci -w=2",
7474
"prepack": "oclif manifest && oclif readme --no-aliases",
7575
"postpack": "rm -f oclif.manifest.json",

src/commands/console/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,26 @@ class ConsoleCommand extends Command {
6363
* @param {string} [options.alternativeFormat] can be set to: 'json', 'yml'
6464
*/
6565
printConsoleConfig (options = {}) {
66-
const config = {}
67-
config.org = this.getConfig('org.name')
68-
config.project = this.getConfig('project.name')
69-
config.workspace = this.getConfig('workspace.name')
66+
const state = {}
67+
state.org = this.getConfig('org.name')
68+
state.project = this.getConfig('project.title')
69+
state.workspace = this.getConfig('workspace.name')
7070

7171
// handling json output
7272
if (options.alternativeFormat === 'json') {
73-
this.printJson(config)
73+
this.printJson(state)
7474
return
7575
}
7676

7777
if (options.alternativeFormat === 'yml') {
78-
this.printYaml(config)
78+
this.printYaml(state)
7979
return
8080
}
8181

8282
this.log('You are currently in:')
83-
this.log(`1. Org: ${config.org || '<no org selected>'}`)
84-
this.log(`2. Project: ${config.project || '<no project selected>'}`)
85-
this.log(`3. Workspace: ${config.workspace || '<no workspace selected>'}`)
83+
this.log(`1. Org: ${state.org || '<no org selected>'}`)
84+
this.log(`2. Project: ${state.project || '<no project selected>'}`)
85+
this.log(`3. Workspace: ${state.workspace || '<no workspace selected>'}`)
8686
}
8787

8888
cleanOutput () {

src/commands/console/project/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SelectCommand extends ConsoleCommand {
3535
this.setConfig(CONFIG_KEYS.PROJECT, project)
3636
this.clearConfig(CONFIG_KEYS.WORKSPACE)
3737

38-
this.log(`Project selected ${project.name}`)
38+
this.log(`Project selected : ${project.title}`)
3939

4040
this.printConsoleConfig()
4141
} catch (err) {

test/commands/console/index.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('ConsoleCommand', () => {
119119
if (key === `${CONFIG_KEYS.CONSOLE}.org.name`) {
120120
return 'THE_ORG'
121121
}
122-
if (key === `${CONFIG_KEYS.CONSOLE}.project.name`) {
122+
if (key === `${CONFIG_KEYS.CONSOLE}.project.title`) {
123123
return 'THE_PROJECT'
124124
}
125125
return null
@@ -136,7 +136,7 @@ describe('ConsoleCommand', () => {
136136
if (key === `${CONFIG_KEYS.CONSOLE}.org.name`) {
137137
return 'THE_ORG'
138138
}
139-
if (key === `${CONFIG_KEYS.CONSOLE}.project.name`) {
139+
if (key === `${CONFIG_KEYS.CONSOLE}.project.title`) {
140140
return 'THE_PROJECT'
141141
}
142142
if (key === `${CONFIG_KEYS.CONSOLE}.workspace.name`) {
@@ -156,7 +156,7 @@ describe('ConsoleCommand', () => {
156156
if (key === `${CONFIG_KEYS.CONSOLE}.org.name`) {
157157
return 'THE_ORG'
158158
}
159-
if (key === `${CONFIG_KEYS.CONSOLE}.project.name`) {
159+
if (key === `${CONFIG_KEYS.CONSOLE}.project.title`) {
160160
return 'THE_PROJECT'
161161
}
162162
if (key === `${CONFIG_KEYS.CONSOLE}.workspace.name`) {
@@ -181,7 +181,7 @@ describe('ConsoleCommand', () => {
181181
if (key === `${CONFIG_KEYS.CONSOLE}.org.name`) {
182182
return 'THE_ORG'
183183
}
184-
if (key === `${CONFIG_KEYS.CONSOLE}.project.name`) {
184+
if (key === `${CONFIG_KEYS.CONSOLE}.project.title`) {
185185
return 'THE_PROJECT'
186186
}
187187
if (key === `${CONFIG_KEYS.CONSOLE}.workspace.name`) {

test/commands/console/publickey/delete.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ describe('console:publickey:delete', () => {
202202
if (key === 'console.project.id') {
203203
return '123'
204204
}
205-
if (key === 'console.project.name') {
205+
if (key === 'console.project.title') {
206206
return 'THE_PROJECT'
207207
}
208208
return null

test/commands/console/publickey/list.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ describe('console:publickey:list', () => {
176176
if (key === 'console.project.id') {
177177
return '123'
178178
}
179-
if (key === 'console.project.name') {
179+
if (key === 'console.project.title') {
180180
return 'THE_PROJECT'
181181
}
182182
return null

test/commands/console/publickey/upload.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ describe('console:publickey:upload', () => {
219219
if (key === 'console.project.id') {
220220
return '123'
221221
}
222-
if (key === 'console.project.name') {
222+
if (key === 'console.project.title') {
223223
return 'THE_PROJECT'
224224
}
225225
return null

test/commands/console/workspace/download.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ function setDefaultMockConfigGet () {
5555
if (key === 'console.project.id') {
5656
return configProjectId
5757
}
58-
if (key === 'console.workspace.id') {
59-
return configWorkspaceId
60-
}
6158
if (key === 'console.project.name') {
6259
return configProjectName
6360
}
61+
if (key === 'console.workspace.id') {
62+
return configWorkspaceId
63+
}
6464
if (key === 'console.workspace.name') {
6565
return configWorkspaceName
6666
}
@@ -187,7 +187,7 @@ test('should download the config for the selected workspace, config workspaceNam
187187
if (key === 'console.workspace.id') {
188188
return configWorkspaceId
189189
}
190-
if (key === 'console.project.name') {
190+
if (key === 'console.project.title') {
191191
return configProjectName
192192
}
193193
})
@@ -225,7 +225,7 @@ test('should fail if the workspace config is missing', async () => {
225225
if (key === 'console.project.id') {
226226
return configProjectId
227227
}
228-
if (key === 'console.project.name') {
228+
if (key === 'console.project.title') {
229229
return configProjectName
230230
}
231231
if (key === 'console.org.name') {

0 commit comments

Comments
 (0)