Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduces download time #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v23.0.8
v24.0.11
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { execSync } = require('child_process');
const commander = require('commander');
const fssync = require('fs');
const fs = fssync.promises;
const git = require('simple-git/promise');
const git = require('simple-git');
const glob = require('glob-gitignore');
const parseGitignore = require('parse-gitignore');
const path = require('path');
Expand Down Expand Up @@ -82,11 +82,10 @@ async function build (cmd) {
// Clone server repo and checkout to provided version
const buildGit = git(buildDir);
logMessage("Server: Cloning Repo");
await buildGit.clone(config.repo, config.name, ['--recursive']);
await buildGit.clone(config.repo, config.name, { '--recursive': null, '--depth': 1, '--branch': version });
logMessage("Server: Clone Complete");
const serverPath = `${buildDir}/${config.name}`;
const serverGit = git(serverPath);
await serverGit.checkout(version);
await serverGit.submoduleUpdate();
const versionHash = await serverGit.revparse(['HEAD']);
await fs.writeFile(`${serverPath}/version.php`, versionFile((await fs.readFile(`${serverPath}/version.php`)).toString(), versionHash, { versionString: config.versionString, updateChannel: config.updateChannel }));
Expand Down Expand Up @@ -195,10 +194,9 @@ async function addApp (appName, appsDir, appConfig) {
}
if (appConfig.repo) {
logMessage(`${appName}: Cloning repo`);
await git(appsDir).clone(appConfig.repo, appName, ['--recursive']);
await git(appsDir).clone(appConfig.repo, appName, { '--recursive': null, '--depth': 1, '--branch': appConfig.version });
logMessage(`${appName}: Repo clone done`);
const appGit = git(appDir);
await appGit.checkout(appConfig.version);
await appGit.submoduleUpdate();
}

Expand Down
Loading