mirror of
https://github.com/lucaspalomodevelop/JSSTE.git
synced 2026-03-12 23:17:22 +00:00
add jsste_info to cmd
This commit is contained in:
parent
1bddfdd4fd
commit
ac53995608
@ -56,7 +56,14 @@ app.render = function (pagecode, templatecode) {
|
||||
pagecode = JSON.parse(pagecode);
|
||||
app.setState({ status: 0, statusMSG: "Parse Pagecode" });
|
||||
} else {
|
||||
app.setState({ status: 1, statusMSG: "Pagecode is undefined" });
|
||||
if(typeof pagecode === "object")
|
||||
{
|
||||
app.setState({ status: 0, statusMSG: "Pagecode is an object" });
|
||||
}
|
||||
else{
|
||||
app.setState({ status: 1, statusMSG: "Pagecode is undefined" });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!templatecode) {
|
||||
|
||||
@ -6,6 +6,12 @@ var app = {};
|
||||
|
||||
app.render = engine.render;
|
||||
app.CONST = engine.CONST;
|
||||
|
||||
let pj = require("../package.json")
|
||||
|
||||
app.info = {};
|
||||
app.info["version"] = pj.version
|
||||
app.info["license"] = pj.license
|
||||
/**
|
||||
* Render File
|
||||
* @param {*} filePath
|
||||
|
||||
@ -3,6 +3,16 @@
|
||||
*/
|
||||
function Added() {
|
||||
let outString = "";
|
||||
|
||||
//[jsste_info]
|
||||
|
||||
function jsste_info()
|
||||
{
|
||||
let jssteinfo = jsste_input_file
|
||||
result = `\tINFOS\n\t${Object.keys(jssteinfo).map((key) => key + " : " + jssteinfo[key] ).join("\n\t") }`
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function out(arg) {
|
||||
outString += arg;
|
||||
@ -26,8 +36,14 @@ function exec(script) {
|
||||
script
|
||||
);
|
||||
|
||||
script = script.replace("//[jsste_info]",`let jsste_input_file = ${JSON.stringify(require("./index").info)}`),
|
||||
|
||||
// console.log(`a: }`)
|
||||
|
||||
script += "\n return outString;";
|
||||
|
||||
// console.log(script)
|
||||
|
||||
try {
|
||||
let F = new Function(script);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user