mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-18 18:50:58 +03:00
Dependencies now install during update
This commit is contained in:
@@ -137,9 +137,6 @@ async function startServer() {
|
||||
});
|
||||
}
|
||||
|
||||
// getLatestVersion();
|
||||
// restartServer();
|
||||
updateServer();
|
||||
}
|
||||
|
||||
async function restartServer() {
|
||||
@@ -173,6 +170,9 @@ async function updateServer() {
|
||||
// grab new package.json and public folder
|
||||
await downloadUpdateFiles();
|
||||
|
||||
// run npm install
|
||||
await installDependencies();
|
||||
|
||||
restartServer();
|
||||
});
|
||||
}
|
||||
@@ -244,6 +244,16 @@ async function downloadLatestRelease(tag) {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async function installDependencies() {
|
||||
return new Promise(resolve => {
|
||||
var child_process = require('child_process');
|
||||
child_process.execSync('npm install',{stdio:[0,1,2]});
|
||||
resolve(true);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// helper function to download file using fetch
|
||||
const fetchFile = (async (url, path) => {
|
||||
const res = await fetch(url);
|
||||
|
||||
Reference in New Issue
Block a user