Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session 7 - using child Processes #38

Open
Fabiomfff opened this issue Sep 20, 2023 · 0 comments
Open

Session 7 - using child Processes #38

Fabiomfff opened this issue Sep 20, 2023 · 0 comments

Comments

@Fabiomfff
Copy link

//---------------------------------list logs
cli.responders.listLogs = function () {
cli.verticalSpace();
var ls = childProcess.spawn('ls', ['./.logs/']);
ls.stdout.on('data', function (dataObj) {
// Explode into separate lines
var dataStr = dataObj.toString();
var logFileNames = dataStr.split('\n');
logFileNames.forEach(function (logFileName) {
if (typeof (logFileName) == 'string' && logFileName.trim().length > 0 && logFileName.indexOf('-') > -1) {
console.log(logFileName.trim().split('.')[0]);
cli.verticalSpace();
}
});
});
};

It says that spawn LS is ENOENT, i tried to use the entire coppied path to .logs but it does not work, if i find a fix i will post it here, for now its not working for me at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant