chore: disable pull command for now

This commit is contained in:
EscapeB 2024-03-05 09:35:26 +08:00
parent e3ce816454
commit 7076806420
2 changed files with 18 additions and 2 deletions
apps/sparo-lib/src

View file

@ -11,7 +11,7 @@ import { GitCheckoutCommand } from './git-checkout';
import { GitFetchCommand } from './git-fetch';
import { GitPullCommand } from './git-pull';
import { InitProfileCommand } from './init-profile';
import { PullCommand } from './pull';
// import { PullCommand } from './pull';
// When adding new Sparo subcommands, remember to update this doc page:
// https://github.com/tiktok/sparo/blob/main/apps/website/docs/pages/commands/overview.md
@ -23,7 +23,8 @@ export const COMMAND_LIST: Constructable[] = [
CloneCommand,
CheckoutCommand,
FetchCommand,
PullCommand,
// Should be introduced after sparo merge|rebase
// PullCommand,
// The commands customized by Sparo require a mirror command to Git
GitCloneCommand,

View file

@ -86,6 +86,10 @@ export class GitSparseCheckoutService {
await this._rushSparseCheckoutAsync({ checkoutAction: 'purge' });
}
/**
*
* @param options
*/
private async _rushSparseCheckoutAsync(options: IRushSparseCheckoutOptions): Promise<void> {
const {
to,
@ -179,6 +183,17 @@ export class GitSparseCheckoutService {
{
const stopwatch: Stopwatch = Stopwatch.start();
/**
* Perform different logic based on checkoutAction
*
* "purge" : reset repo to skeleton, will remove other paths in checkout paths list
*
* "skeleton" : checkout skeleton in repo, will only add skeleton paths to checkout paths list
*
* "set" : set checkout paths list by invoking "git sparse-checkout set", will implicitly add skeleton paths to this list.
*
* "add" : add a list of paths to checkout list by invoking "git sparse-checkout add"
*/
switch (checkoutAction) {
case 'purge':
case 'skeleton':