Skip to content

Commit

Permalink
feat(cli): introduce first CLI command: domain-dump (#360)
Browse files Browse the repository at this point in the history
* WIP Introduce domain-dump CLI command

* feat(cli): introduce first CLI command: domain-dump

* fix a couple Sonar cloud issues

* Add error handling to CLI bootstrap call

* fix issue with test output data path

* refactor basedon PR (#360)

* use hard-wired test datafile name

* tweak test file output name
  • Loading branch information
aaron-plahn committed May 23, 2023
1 parent 8d84ad1 commit a8baae6
Show file tree
Hide file tree
Showing 11 changed files with 5,956 additions and 25,844 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ auth_config.json
**content.config.ts
# TODO Be careful not to git-ignore third-party configs
**config.json

# COSCRAD CLI command e2e test dummy files
__cli-command-test-files__
13 changes: 13 additions & 0 deletions apps/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@
"with": "apps/api/src/environments/environment.prod.ts"
}
]
},
"cli": {
"outputPath": "dist/apps/coscrad-cli",
"main": "apps/api/src/cli.ts",
"optimization": true,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
{
"replace": "apps/api/src/environments/environment.ts",
"with": "apps/api/src/environments/environment.prod.ts"
}
]
}
}
},
Expand Down
11 changes: 11 additions & 0 deletions apps/api/src/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { CommandFactory } from 'nest-commander';
import { CoscradCliModule } from './coscrad-cli/coscrad-cli.module';
import { InternalError } from './lib/errors/InternalError';

async function bootstrapCli() {
await CommandFactory.run(CoscradCliModule);
}

bootstrapCli().catch((err) => {
throw new InternalError(`Failed to bootstrap COSCRAD CLI: ${err}`);
});
Loading

0 comments on commit a8baae6

Please sign in to comment.