Skip to content

Commit a8640f3

Browse files
azure-sdkraych1
andauthored
Sync eng/common directory with azure-sdk-tools for PR 12454 (Azure#3182)
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#12454 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: Ray Chen <[email protected]>
1 parent 7ff0b47 commit a8640f3

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

eng/common/tsp-client/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,32 @@ npm ci
2525

2626
## Usage
2727

28-
After installation, you can run tsp-client by navigating to the directory and using npm exec:
28+
After installation, you can run `tsp-client` using `npm exec --prefix {path_to_the_eng/common/tsp-client}`.
29+
Note that you should *not* navigate into the `eng/common/tsp-client` folder, since several `tsp-client` commands require the current working directory to be the client library's root.
2930

3031
```bash
31-
cd eng/common/tsp-client
32+
# Set the tsp-client directory path relative to your current working directory
33+
_TspClientDir=eng/common/tsp-client
3234

3335
# Get help
34-
npm exec --no -- tsp-client --help
36+
npm exec --prefix ${_TspClientDir} --no -- tsp-client --help
3537

3638
# Check version
37-
npm exec --no -- tsp-client version
39+
npm exec --prefix ${_TspClientDir} --no -- tsp-client version
3840

3941
# Generate client code
40-
npm exec --no -- tsp-client generate --output-dir ./generated
42+
npm exec --prefix ${_TspClientDir} --no -- tsp-client generate --output-dir ./generated
4143

4244
# Initialize a new project
43-
npm exec --no -- tsp-client init --tsp-config ./tspconfig.yaml
45+
npm exec --prefix ${_TspClientDir} --no -- tsp-client init --tsp-config ./tspconfig.yaml
4446
```
4547

4648
## CI/CD Best Practices
4749

4850
```bash
49-
cd eng/common/tsp-client
50-
npm ci
51-
npm exec --no -- tsp-client init --update-if-exists --tsp-config https://github.com/Azure/azure-rest-api-specs/blob/dee71463cbde1d416c47cf544e34f7966a94ddcb/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml
51+
_TspClientDir=eng/common/tsp-client
52+
npm ci --prefix ${_TspClientDir}
53+
npm exec --prefix ${_TspClientDir} --no -- tsp-client init --update-if-exists --tsp-config https://github.com/Azure/azure-rest-api-specs/blob/dee71463cbde1d416c47cf544e34f7966a94ddcb/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml
5254
```
5355

5456
## Package Management

0 commit comments

Comments
 (0)