EmbeddedEnterprises / cmake-ts

Typescript based rewrite of cmake-js to support cross compilation
9 stars 3 forks source link

Error generated if make is not present due to wrong usage of 'which' #21

Closed robinchrist closed 2 years ago

robinchrist commented 2 years ago

Native builds on Windows fail, because of wrong usage of which if make is not present

> Distribution File Download... C:\devspace\node-corelib\node_modules\which\which.js:10
  Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })
                ^

Error: not found: make
    at getNotFoundError (C:\devspace\node-corelib\node_modules\which\which.js:10:17)
    at C:\devspace\node-corelib\node_modules\which\which.js:57:18
    at new Promise (<anonymous>)
    at step (C:\devspace\node-corelib\node_modules\which\which.js:54:21)
    at C:\devspace\node-corelib\node_modules\which\which.js:71:22
    at new Promise (<anonymous>)
    at subStep (C:\devspace\node-corelib\node_modules\which\which.js:69:33)
    at C:\devspace\node-corelib\node_modules\which\which.js:80:22
    at C:\devspace\node-corelib\node_modules\isexe\index.js:42:5
    at C:\devspace\node-corelib\node_modules\isexe\windows.js:36:5
    at FSReqCallback.oncomplete (node:fs:198:21) {
  code: 'ENOENT'
}

The issue is in lib.ts here: https://github.com/EmbeddedEnterprises/cmake-ts/blob/553a035f148a331f7d58a758e81a23461de24675/src/lib.ts#L144-L154

which throws an Error if the specified tool could not be found, hence the issue

martin31821 commented 2 years ago

fixed in 0.2.1