function update (){
  proj = fs.stat(path.join(__dirname, '../vcount.csv'), (err, stats) => {
    if (err){ // Create file
      exec.exec("curl https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv -o vcount.csv -f", { cwd: path.join(__dirname, '..') });
      exec.exec("python3 data.py", { cwd: path.join(__dirname, '..') });
    }
    if ((new Date()).getHours() != stats.mtime.getHours()){
      console.log("updated");
      exec.exec("curl https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv -o vcount.csv -f", { cwd: path.join(__dirname, '..') });
      exec.exec("python3 data.py", { cwd: path.join(__dirname, '..') });
    }
  });
}
// Make sure that our data is updated.
Make sure that our data is updated.
Make sure that our data is updated .
function update (){
  proj = fs.stat(path.join(__dirname, '../vcount.csv'), (err, stats) => {
    if (err){ 
      exec.exec("curl https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv -o vcount.csv -f", { cwd: path.join(__dirname, '..') });
      exec.exec("python3 data.py", { cwd: path.join(__dirname, '..') });
    }
    if ((new Date()).getHours() != stats.mtime.getHours()){
      console.log("updated");
      exec.exec("curl https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv -o vcount.csv -f", { cwd: path.join(__dirname, '..') });
      exec.exec("python3 data.py", { cwd: path.join(__dirname, '..') });
    }
  });
}
function update ( ) { proj = fs . stat ( path . join ( __dirname , '../vcount.csv' ) , ( err , stats ) => { if ( err ) { exec . exec ( "curl https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv -o vcount.csv -f" , { cwd : path . join ( __dirname , '..' ) } ) ; exec . exec ( "python3 data.py" , { cwd : path . join ( __dirname , '..' ) } ) ; } if ( ( new Date ( ) ) . getHours ( ) != stats . mtime . getHours ( ) ) { console . log ( "updated" ) ; exec . exec ( "curl https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv -o vcount.csv -f" , { cwd : path . join ( __dirname , '..' ) } ) ; exec . exec ( "python3 data.py" , { cwd : path . join ( __dirname , '..' ) } ) ; } } ) ; }
Make sure that our data is updated.
Make sure that our data is updated .
// Create file