I have a script up at the moment that downloads a zip file from a permalink, unzips it, delete the old version of the file, and then renames the newly unzipped directory.
exec("unzip recentDatabase.zip", (error, stdout, stderr) => {
if(error){
...
}
if (stderr) {
...
}
...
exec("rm -r recentDatabase ; mv " + DBname + " recentDatabase");
})
for some reason I get the error : " End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive."
I have made a callback statement with this to make sure that this unzip command only runs when it confirms that the http download is finished, and when I run 'unzip recentDatabase.zip' in the terminal it works perfectly fine, it only has issues when I call it from a child process.
Is there something that im doing wrong?