Skip to content

Commit

Permalink
chore: disable pull command for now
Browse files Browse the repository at this point in the history
  • Loading branch information
EscapeB committed Mar 5, 2024
1 parent e3ce816 commit 7076806
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/sparo-lib/src/cli/commands/cmd-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
15 changes: 15 additions & 0 deletions apps/sparo-lib/src/services/GitSparseCheckoutService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export class GitSparseCheckoutService {
await this._rushSparseCheckoutAsync({ checkoutAction: 'purge' });
}

/**
*
* @param options
*/
private async _rushSparseCheckoutAsync(options: IRushSparseCheckoutOptions): Promise<void> {
const {
to,
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 7076806

Please sign in to comment.