diff --git a/apps/sparo-lib/src/cli/commands/cmd-list.ts b/apps/sparo-lib/src/cli/commands/cmd-list.ts index 99ee585..8d95350 100644 --- a/apps/sparo-lib/src/cli/commands/cmd-list.ts +++ b/apps/sparo-lib/src/cli/commands/cmd-list.ts @@ -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, diff --git a/apps/sparo-lib/src/services/GitSparseCheckoutService.ts b/apps/sparo-lib/src/services/GitSparseCheckoutService.ts index afdd211..c449f6b 100644 --- a/apps/sparo-lib/src/services/GitSparseCheckoutService.ts +++ b/apps/sparo-lib/src/services/GitSparseCheckoutService.ts @@ -86,6 +86,10 @@ export class GitSparseCheckoutService { await this._rushSparseCheckoutAsync({ checkoutAction: 'purge' }); } + /** + * + * @param options + */ private async _rushSparseCheckoutAsync(options: IRushSparseCheckoutOptions): Promise { 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':