new CommonValidations()
- Source:
Properties:
Name | Type | Description |
---|---|---|
MK_BUILD_DIR_INVALID |
string | The translation key of message to show when current directory is not a MasteryJS build directory |
MK_ROOT_DIR_INVALID |
string | The translation key of message to show when current directory is not a MasteryJS root directory |
Provides common validations static methods
Methods
(static) validateBuildDir(basePathopt)
- Source:
Throw an error if directory isn't a MasteryJS build directory, a directory that contains a mastery.run.json file
Example
// Returns a thrown error
process.chdir('/Users/labibramadhan/Desktop');
validateBuildDir();
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
basePath |
string |
<optional> |
.
|
The relative path to check |
(static) validateRootDir(basePathopt)
- Source:
Throw an error if directory isn't a root directory, a directory that contains a package.json file & others (see files variables below)
Example
// Returns a thrown error
process.chdir('build');
validateRootDir();
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
basePath |
string |
<optional> |
.
|
The relative path to check |