@nomadmystic/wordpress-scaffold-cli
Version:
This project is created to speed up WordPress development
50 lines (43 loc) • 1.3 kB
text/typescript
// Community modules
import 'dotenv/config';
import fs from "fs";
import colors from "colors";
/**
* @class DebugUtils
*/
export default class DebugUtils {
/**
* @description Check if local DEBUG and WORDPRESS_PATH .env variables are set
* @public
*
* @return Promise<boolean>
*/
public static isDebugFullMode = async (): Promise<boolean> => {
// Enable debug mode?
const isDebugMode: boolean = await this.isDebugMode();
const wordPressDebugPath: boolean = await this.isDebugWordPressPath();
return isDebugMode && wordPressDebugPath;
};
/**
* @description Check if local DEBUG .env variable is set
* @public
*
* @return Promise<boolean>
*/
public static isDebugMode = async (): Promise<boolean> => {
// Enable debug mode?
const isDebugMode: boolean = !!process.env?.DEBUG;
return isDebugMode;
};
/**
* @description Check if local WORDPRESS_PATH .env variable is set
* @public
*
* @return Promise<boolean>
*/
public static isDebugWordPressPath = async (): Promise<boolean> => {
// Enable WordPress path?
const wordPressDebugPath: boolean = !!process.env?.WORDPRESS_PATH;
return wordPressDebugPath;
};
}