66 lines
2.0 KiB
JavaScript
66 lines
2.0 KiB
JavaScript
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
var info_exports = {};
|
|
__export(info_exports, {
|
|
cliInfo: () => cliInfo
|
|
});
|
|
module.exports = __toCommonJS(info_exports);
|
|
var import_utils = require("../../../utils");
|
|
var import_validate_params = require("./validate-params");
|
|
const compilerList = [
|
|
"node-sass",
|
|
"sass",
|
|
"sass-embedded"
|
|
];
|
|
function cliInfo(params) {
|
|
try {
|
|
(0, import_validate_params.validateParams)(params);
|
|
} catch (err) {
|
|
(0, import_utils.exit)(1, "error", "cli > info", err.message);
|
|
}
|
|
const compilerInfo = getCompilerInfo(compilerList);
|
|
if (compilerInfo.length > 0) {
|
|
process.stdout.write("The following sass compilers are installed:\n");
|
|
compilerInfo.forEach((info) => {
|
|
const [main] = info.split("\n");
|
|
const [compiler, version] = main.split(" ");
|
|
process.stdout.write(`- ${compiler} ${version}
|
|
`);
|
|
});
|
|
} else {
|
|
process.stdout.write("No sass compilers found!\n");
|
|
}
|
|
}
|
|
function getCompilerInfo(compilerList2) {
|
|
const compilerInfo = [];
|
|
compilerList2.forEach((name) => {
|
|
try {
|
|
const { info } = require(name);
|
|
if (info) {
|
|
compilerInfo.push(info);
|
|
}
|
|
} catch (e) {
|
|
}
|
|
});
|
|
return compilerInfo;
|
|
}
|
|
// Annotate the CommonJS export names for ESM import in node:
|
|
0 && (module.exports = {
|
|
cliInfo
|
|
});
|