dachev / node-crontab

A module for creating, reading, updating, and deleting system cron jobs
189 stars 35 forks source link

job.minute().toString() returns * #31

Closed sathia-musso closed 4 years ago

sathia-musso commented 5 years ago

it seems to me that no matter what value is set on the tab it always returns * instead of the correct minute

the object returned has all the correct values but it ignores completely the minutes and other time values.

    let job = tab.jobs({command: command}) [...]

    config.cron = job.map(c => {

      let t = {};
      for(i in c){
        t[i] = c[i]();
        console.log(i, c[i]());
        if(i=="minute"){
          console.log(i, c[i]().toString()); // logs: minute *  where the task has: 10 * * * * 
        }
      }

    })

ie:

render 11 * * * * task.sh blabla
toString * * * * * 

tested on osx and linux

dachev commented 4 years ago

I can't help you without a reproducible test case.