update
This commit is contained in:
parent
1ff07a2dd4
commit
347a0758e0
@ -19,11 +19,13 @@
|
||||
"author": "Zengtudor",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@types/minimist": "^1.2.5",
|
||||
"@types/node": "^22.2.0",
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.21",
|
||||
"minimist": "^1.2.8",
|
||||
"ts-node": "^10.9.2"
|
||||
}
|
||||
|
@ -1,8 +1,14 @@
|
||||
import { cloneDeep } from "lodash"
|
||||
import NmakeGlobal from "../interface/NmakeGlobal"
|
||||
import printDebug from "../Tools/DebugPrint"
|
||||
|
||||
const project = (name:string,callback:Function) =>{
|
||||
const oldGlobal = (global as any).nmake as unknown as NmakeGlobal
|
||||
const nGlobal = cloneDeep(((global as any).nmake as unknown as NmakeGlobal));
|
||||
(global as any).nmake = nGlobal
|
||||
printDebug("adding project :"+name)
|
||||
callback()
|
||||
(global as any).nmake = oldGlobal
|
||||
}
|
||||
|
||||
export default project
|
@ -1,9 +1,9 @@
|
||||
import NmakeGlobal from "../interface/NmakeGlobal"
|
||||
import { getGlobalNmake, Global } from "./GlobalStack"
|
||||
|
||||
const constructGlobal = ()=>{
|
||||
(global as any).projects = [];
|
||||
const nmakeGlobal = global as unknown as NmakeGlobal
|
||||
|
||||
Global.nmake = {}
|
||||
Global.nmake.projects = {} as NmakeGlobal[]
|
||||
}
|
||||
|
||||
export default constructGlobal
|
22
src/Tools/GlobalStack.ts
Normal file
22
src/Tools/GlobalStack.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { cloneDeep } from "lodash"
|
||||
import NmakeGlobal from "../interface/NmakeGlobal"
|
||||
import printDebug from "./DebugPrint"
|
||||
|
||||
export const Global = global as any
|
||||
let globalNmakeStacks = Global.globalStacks as NmakeGlobal[]
|
||||
|
||||
export const pushGlobalStack = () =>{
|
||||
if(!Global.globalStacks){Global.globalStacks = [];globalNmakeStacks = Global.globalStacks as NmakeGlobal[]}
|
||||
printDebug("pushing global stack")
|
||||
globalNmakeStacks.push(Global.nmake)
|
||||
Global.nmake = cloneDeep(Global.nmake)
|
||||
}
|
||||
|
||||
export const popGlobalStack = ()=>{
|
||||
Global.nmake = globalNmakeStacks[globalNmakeStacks.length-1]
|
||||
globalNmakeStacks.pop()
|
||||
}
|
||||
|
||||
export const getGlobalNmake=():NmakeGlobal=>{
|
||||
return Global.nmake
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
import { execSync } from "child_process";
|
||||
import GppCompiler from "../../src/Compiler/GppCompiler";
|
||||
|
||||
|
||||
(global as any).isDebug=true;
|
||||
// const a = new GppCompiler()
|
||||
// console.log(a.compilerVersion)
|
||||
console.log(execSync("g++ -v").toLocaleString())
|
||||
// console.log(execSync("g++ --version").toString().trim())
|
Loading…
Reference in New Issue
Block a user