Skip to content

Commit 6ba8c81

Browse files
Merge pull request #795 from contentstack/bugfix/CS-38356
CS-38356-Added error message if the region is not configured before using csdx launch command
2 parents 213af59 + 8a64c2f commit 6ba8c81

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

packages/contentstack-command/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-command",
33
"description": "Contentstack CLI plugin for configuration",
4-
"version": "1.2.4",
4+
"version": "1.2.5",
55
"author": "Contentstack",
66
"main": "lib/index.js",
77
"types": "./types/index.d.ts",

packages/contentstack-command/src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as ContentstackDeliverySDK from 'contentstack';
22
import { URL } from 'url';
3-
import { configHandler, CLIError, Command } from '@contentstack/cli-utilities';
3+
import { configHandler, CLIError, Command, cliux } from '@contentstack/cli-utilities';
44
import { Region } from './interfaces';
55

66
const defaultRateLimit = 5;
@@ -33,7 +33,11 @@ abstract class ContentstackCommand extends Command {
3333
get region() {
3434
if (this._region) return this._region;
3535
this._region = configHandler.get('region');
36-
if (this._region) return this._region;
36+
if(!this._region) {
37+
cliux.print("Error: Region not configured. Please set the region.",{color:"red"})
38+
process.exit(1)
39+
}
40+
else return this._region;
3741
}
3842

3943
get rateLimit() {

0 commit comments

Comments
 (0)