Do shallow clone to speed-up extension installs

This commit is contained in:
Cohee 2023-10-23 13:27:04 +03:00
parent 9a647b96df
commit e082138c18
2 changed files with 3 additions and 1 deletions

View File

@ -705,6 +705,8 @@ async function getExtensionVersion(extensionName) {
export async function installExtension(url) {
console.debug('Extension import started', url);
toastr.info('Please wait...', 'Importing extension');
const request = await fetch('/api/extensions/install', {
method: 'POST',
headers: getRequestHeaders(),

View File

@ -79,7 +79,7 @@ function registerEndpoints(app, jsonParser) {
return response.status(409).send(`Directory already exists at ${extensionPath}`);
}
await git.clone(url, extensionPath);
await git.clone(url, extensionPath, { '--depth': 1 });
console.log(`Extension has been cloned at ${extensionPath}`);