Skip to content

Commit

Permalink
Merge pull request #11 from tiktok/fix-housekeeping
Browse files Browse the repository at this point in the history
Fix housekeeping
  • Loading branch information
chengcyber authored Feb 22, 2024
2 parents f3ed8fb + 40e2fab commit 911c180
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 34 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI
on:
push:
branches: ['main']
pull_request:
branches: ['main']

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.platform }}-${{ matrix.node }}
cancel-in-progress: true

strategy:
fail-test: false
matrix:
node:
- '16'
platform:
- ubuntu-latest

name: '${{ matrix.platform }} / Node.js ${{ matrix.node }}'
runs-on: ${{ matrix.platform }}

steps:
- name: Configure Git
run: |
git config --local user.name tiktokbot
git config --local user.email tiktokbot@users.noreply.github.com
- name: Checkout Commit
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Verify Change Logs
run: node common/scripts/install-run-rush.js change --verify
- name: Rush Install
run: node common/scripts/install-run-rush.js install
- name: Rush rebuild
run: node common/scripts/install-run-rush.js rebuild --verbose --production
- name: Rush test
run: node common/scripts/install-run-rush.js test --verbose
28 changes: 0 additions & 28 deletions .github/workflows/main.yml

This file was deleted.

2 changes: 1 addition & 1 deletion apps/sparo-lib/src/cli/SparoCommandLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class SparoCommandLine {
// proxy to gitService
if (!this._supportedCommand(userInputCmdName)) {
const gitService: GitService = await getFromContainerAsync(GitService);
const args: string[] = process.argv.slice(2);
const args: string[] = argv.stripSparoArgs(process.argv.slice(2));
gitService.executeGitCommand({
args
});
Expand Down
5 changes: 0 additions & 5 deletions apps/sparo-lib/src/cli/commands/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ export class CheckoutCommand implements ICommand<ICheckoutCommandOptions> {
args: ArgumentsCamelCase<ICheckoutCommandOptions>,
terminalService: TerminalService
): Promise<void> => {
console.log(JSON.stringify(args, null, 2));
const a: number = 1;
if (a > 0) {
process.exit(1);
}
const { _gitService: gitService, _localState: localState } = this;
const { b, B, branch, startPoint } = args;

Expand Down
11 changes: 11 additions & 0 deletions apps/sparo-lib/src/services/ArgvService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ export class ArgvService {
return String(this._parsed._[0] || '');
}

public stripSparoArgs(args: string[]): string[] {
const newArgs: string[] = [];
for (const arg of args) {
if (['--debug', '--verbose'].includes(arg)) {
continue;
}
newArgs.push(arg);
}
return newArgs;
}

private _terminalMiddleware: MiddlewareFunction<{
debug: boolean | undefined;
verbose: boolean | undefined;
Expand Down
10 changes: 10 additions & 0 deletions common/changes/sparo/fix-housekeeping_2024-02-22-01-36.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "sparo",
"comment": "Remove housekeeping code",
"type": "none"
}
],
"packageName": "sparo"
}

0 comments on commit 911c180

Please sign in to comment.