mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 17:50:07 +08:00
21 lines
326 B
JavaScript
21 lines
326 B
JavaScript
'use strict';
|
|
const chalk = require('chalk');
|
|
|
|
let ctx = null;
|
|
exports.get = () => {
|
|
if (!ctx) {
|
|
throw new Error('Chalk has not yet been configured');
|
|
}
|
|
|
|
return ctx;
|
|
};
|
|
|
|
exports.set = options => {
|
|
if (ctx) {
|
|
throw new Error('Chalk has already been configured');
|
|
}
|
|
|
|
ctx = new chalk.Instance(options);
|
|
return ctx;
|
|
};
|