Files
Marc 721c919c7b ChibraxOS 2
Changes:
- kernel 6.0.2
- Broken init scripts
- Switch to bun for better peroformance an easier ffi
- Removed grup
- Efi support without graphics (at least graphics werent tested)
- Suppression de toutes les dépendance non libc
- new splash
- broken audio
- typescript support
- ls rewritten to be more reliable
2022-10-22 13:47:33 +02:00

24 lines
667 B
JavaScript

import * as fs from 'fs'
import { resolve } from 'path';
if(process.argv.length >= 3){
// console.log(process.env.path)
for(let environmentPath of process.env.path.split(',')){
console.log(recursiveSearch(environmentPath, process.argv[3]));
}
}
function recursiveSearch(dir, bin){
result = []
const dirents = fs.readdirSync(dir, {withFileTypes: true});
for(const dirent of dirents){
const res = resolve(dir, dirent.name);
if(dirent.name === bin){
result.push(res);
}
if(dirent.isDirectory())
result = result.concat(recursiveSearch(dirent.name, bin))
}
return result;
}