Skip to content

Commit 99790f3

Browse files
authored
Give better signal that orgslug is missing (#422)
* Give better signal that orgslug is missing * o
1 parent 44de46e commit 99790f3

File tree

6 files changed

+36
-18
lines changed

6 files changed

+36
-18
lines changed

src/commands/scan/cmd-scan-create.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,14 @@ async function run(
236236

237237
const wasBadInput = handleBadInput(
238238
{
239-
nook: true,
240-
test: orgSlug,
239+
nook: !!defaultOrgSlug,
240+
test: orgSlug && orgSlug !== '.',
241241
message: 'Org name as the first argument',
242242
pass: 'ok',
243-
fail: 'missing'
243+
fail:
244+
orgSlug === '.'
245+
? 'dot is an invalid org, most likely you forgot the org name here?'
246+
: 'missing'
244247
},
245248
{
246249
test: targets.length,

src/commands/scan/cmd-scan-del.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@ async function run(
6262

6363
const wasBadInput = handleBadInput(
6464
{
65-
nook: true,
66-
test: orgSlug,
65+
nook: !!defaultOrgSlug,
66+
test: orgSlug && orgSlug !== '.',
6767
message: 'Org name as the first argument',
6868
pass: 'ok',
69-
fail: 'missing'
69+
fail:
70+
orgSlug === '.'
71+
? 'dot is an invalid org, most likely you forgot the org name here?'
72+
: 'missing'
7073
},
7174
{
7275
test: scanId,

src/commands/scan/cmd-scan-list.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,14 @@ async function run(
102102

103103
const wasBadInput = handleBadInput(
104104
{
105-
nook: true,
106-
test: orgSlug,
105+
nook: !!defaultOrgSlug,
106+
test: orgSlug && orgSlug !== '.',
107107
message: 'Org name as the first argument',
108108
pass: 'ok',
109-
fail: 'missing'
109+
fail:
110+
orgSlug === '.'
111+
? 'dot is an invalid org, most likely you forgot the org name here?'
112+
: 'missing'
110113
},
111114
{
112115
nook: true,

src/commands/scan/cmd-scan-metadata.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@ async function run(
6666

6767
const wasBadInput = handleBadInput(
6868
{
69-
nook: true,
70-
test: orgSlug,
69+
nook: !!defaultOrgSlug,
70+
test: orgSlug && orgSlug !== '.',
7171
message: 'Org name as the first argument',
7272
pass: 'ok',
73-
fail: 'missing'
73+
fail:
74+
orgSlug === '.'
75+
? 'dot is an invalid org, most likely you forgot the org name here?'
76+
: 'missing'
7477
},
7578
{
7679
test: scanId,

src/commands/scan/cmd-scan-report.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,14 @@ async function run(
105105

106106
const wasBadInput = handleBadInput(
107107
{
108-
nook: true,
109-
test: orgSlug,
108+
nook: !!defaultOrgSlug,
109+
test: orgSlug && orgSlug !== '.',
110110
message: 'Org name as the first argument',
111111
pass: 'ok',
112-
fail: 'missing'
112+
fail:
113+
orgSlug === '.'
114+
? 'dot is an invalid org, most likely you forgot the org name here?'
115+
: 'missing'
113116
},
114117
{
115118
test: scanId,

src/commands/scan/cmd-scan-view.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ async function run(
7070

7171
const wasBadInput = handleBadInput(
7272
{
73-
nook: true,
74-
test: orgSlug,
73+
nook: !!defaultOrgSlug,
74+
test: orgSlug && orgSlug !== '.',
7575
message: 'Org name as the first argument',
7676
pass: 'ok',
77-
fail: 'missing'
77+
fail:
78+
orgSlug === '.'
79+
? 'dot is an invalid org, most likely you forgot the org name here?'
80+
: 'missing'
7881
},
7982
{
8083
test: scanId,

0 commit comments

Comments
 (0)