Skip to content

Commit

Permalink
Merge pull request #8152 from praneesha/fix-bash-code-snippets
Browse files Browse the repository at this point in the history
Remove bash from code snippets
  • Loading branch information
sm1990 committed Nov 1, 2023
2 parents 925209d + 82f2d5c commit c877086
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ redirect_from:

The Ballerina project should be initialized with `bal persist` before generating the derived types, clients, and script files. This can be done using the `init` command. You can specify the preferred data store and the module, which you need to generate files. If you do not specify the data store and the module, the default values will be used.

```bash
```
$ bal persist init --datastore="mysql" --module="store"
```

Expand Down Expand Up @@ -58,7 +58,7 @@ Behaviour of the `init` command,

The command below is used to generate the derived types, clients, and script files based on the data model definition file. This command is executed from within the project root directory as follows.

```bash
```
$ bal persist generate
```

Expand Down Expand Up @@ -112,7 +112,7 @@ Behaviour of the `generate` command
The command below generates the migration scripts for the model definition changes. This command is executed in the project root directory. This command will generate the migration scripts based on the changes in the model definition file. The generated migration scripts will be added to the `migrations` directory inside the `persist` directory.

```bash
```
$ bal persist migrate add_employee
```

Expand Down
28 changes: 14 additions & 14 deletions swan-lake/development-tutorials/build-and-run/update-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ You can [change this active distribution](#change-the-active-distribution) at an

The `bal update` command updates the Ballerina Tool itself to the latest version. Ballerina Tool versions are independent of the Ballerina distribution versions. These tool updates are expected to be rare compared to distribution releases.

```bash
```
$ bal update
```

You view the output below.

```bash
```
Fetching the latest tool version from the remote server...
Downloading ballerina-command-1.3.15 100% [=====================================================================================================================================================================] 1/1 MB (0:00:01 / 0:00:00)
Updating environment variables
Expand All @@ -99,13 +99,13 @@ If you want to update the Ballerina distribution, use 'bal dist update'

After updating the Ballerina Tool, you can use the `bal dist` command to manage Ballerina distributions. The `bal help dist` output below shows all the details about the `bal dist` command.

```bash
```
$ bal help dist
```

You view the output below.

```bash
```
NAME
bal dist - Manage Ballerina distributions
Expand Down Expand Up @@ -151,13 +151,13 @@ Most of these subcommands are self-explanatory. Therefore, the sections below in

The `bal dist list` command lists the installed distributions in your local environment. It also lists the distributions available for you to download.

```bash
```
$ bal dist list
```

You view the output below.

```bash
```
Distributions available locally:
* 2201.5.0
Expand Down Expand Up @@ -205,13 +205,13 @@ Use 'bal help dist' for more information on specific commands.

The `bal dist update` command updates your distribution to the latest Ballerina version.

```bash
```
$ sudo bal dist update
```

You view the output below.

```bash
```
Fetching the latest distribution from the remote server...
Fetching the '2201.6.0' distribution from the remote server...
Downloading 2201.6.0 100% [================================================================================================================================================================================] 319/319 MB (0:01:21 / 0:00:00)
Expand All @@ -225,13 +225,13 @@ Successfully set the distribution '2201.6.0' as the active distribution

The `bal dist pull <distribution>` command downloads a particular distribution and stores it in your local environment. It also sets the fetched distribution as the active distribution.

```bash
```
$ bal dist pull 2201.4.1
```

You view the output below.

```bash
```
Fetching the '2201.4.1' distribution from the remote server...
Downloading 2201.4.1 100% [================================================================================================================================================================================] 287/287 MB (0:01:26 / 0:00:00)
Expand All @@ -244,26 +244,26 @@ Dependency 'jdk-11.0.15+10-jre' is already available locally

The `bal dist use <distribution>` command sets a particular distribution version as the active one.

```bash
```
$ bal dist use 2201.4.2
```

You view the output below.

```bash
```
2201.4.2 successfully set as the active distribution
```

### Remove a distribution

The `bal dist remove <distribution>` command allows you to delete a particular distribution from your local environment. If you have been updating Ballerina regularly, you may have accumulated many unused distribution versions. This command helps you to clean them up.

```bash
```
$ bal dist remove 2201.4.0
```

You view the output below.

```bash
```
Distribution '2201.4.0' successfully removed
```
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ You can use these build options along with the graalvm build option (`--graalvm`

The example command below will build the package and run it locally.

```bash
```
$ bal build --cloud="azure_functions_local" --graalvm
```

Expand All @@ -115,7 +115,7 @@ $ bal build --cloud="azure_functions_local" --graalvm

The example command below will build the package for the Azure Functions cloud.

```bash
```
$ bal build --cloud="azure_functions" --graalvm
```

Expand All @@ -129,15 +129,15 @@ You can either deploy the Azure Functions package locally or on the Azure Functi

The example command below will deploy the package locally.

```bash
```
$ func start --script-root target/azure_functions
```

#### Deploy on the cloud

The example command below will deploy the package on the Azure Functions cloud.

```bash
```
$ func azure functionapp publish <function_app_name> --script-root target/azure_functions
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ WARNING [mypackage] detected conflicting jar files. 'commons-logging-1.1.1.jar'
```

Note: Ignoring the `groupId` and `artifactId` will result in picking a random jar with the following warning reported by the compiler.
```bash
```
warning: Detected conflicting jar files:
'commons-logging-1.1.1.jar' dependency of 'myorg/pkg1' conflict with 'commons-logging-1.2.jar' dependency of 'myorg/pkg2'
```
Expand Down
3 changes: 2 additions & 1 deletion swan-lake/integration-tools/openapi-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ $ bal openapi -i <openapi-contract> [-n |--nullable]

### Generate with a given method type
Use the `--client-methods <resource|remote>` option to select the client method type, which can be `resource` or `remote`. (The default option is `remote`).
```bash

```
$ bal openapi -i <openapi-contract> --mode client --client-methods <resource|remote>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Follow the instructions given in this section to develop the service.

1. Create a new Ballerina project using the `bal` command and open it in VS Code.

```bash
```
$ bal new content-based-message-routing
```

Expand Down Expand Up @@ -428,7 +428,7 @@ The [sequence diagram view](https://wso2.com/ballerina/vscode/docs/implement-the

You can run this service by navigating to the project root and using the `bal run` command.

```bash
```
content-based-message-routing$ bal run
Compiling source
integration_tutorials/content_based_message_routing:0.1.0
Expand All @@ -444,7 +444,7 @@ Let's test the use case by sending a request to the service.

Download the JAR file for the [backend service](https://github.com/ballerina-guides/integration-tutorials/blob/main/backends/hospital-service/hospitalservice.jar), and execute the following command to start the service:

```bash
```
bal run hospitalservice.jar
```

Expand Down Expand Up @@ -475,7 +475,7 @@ Let's send a request to the service using cURL as follows.

3. Execute the following command.

```bash
```
curl -v -X POST --data @request.json http://localhost:8290/healthcare/categories/surgery/reserve --header "Content-Type:application/json"
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Follow the instructions given in this section to develop the service.

1. Create a new Ballerina project using the `bal` command and open it in VS Code.

```bash
```
$ bal new sending-a-message-to-a-service
```

Expand Down Expand Up @@ -192,7 +192,7 @@ The [sequence diagram view](https://wso2.com/ballerina/vscode/docs/implement-the

You can run this service by navigating to the project root and using the `bal run` command.

```bash
```
sending-a-message-to-a-service$ bal run
Compiling source
integration_tutorials/sending_a_message_to_a_service:0.1.0
Expand All @@ -208,7 +208,7 @@ Let's test the use case by sending a request to the service.

Download the JAR file for the [backend service](https://github.com/ballerina-guides/integration-tutorials/blob/main/backends/hospital-service/hospitalservice.jar), and execute the following command to start the service:

```bash
```
bal run hospitalservice.jar
```

Expand All @@ -220,7 +220,7 @@ Let's send a request to the service using cURL as follows.

2. Execute the following command.

```bash
```
curl -v http://localhost:8290/healthcare/querydoctor/surgery
```

Expand Down Expand Up @@ -256,7 +256,7 @@ You will see the response message from the backend with a list of details of the

Now, check the terminal in which you ran the Ballerina service. You should see a log similar to the following.

```bash
```
time = 2023-08-15T13:01:34.022+05:30 level = INFO module = integration_tutorials/sending_a_message_to_a_service message = "Retrieving information" specialization = "surgery"
```

Expand Down Expand Up @@ -310,7 +310,7 @@ Let's test the use case by writing a test case that sends a request to the servi

4. Run the `bal test` command from the project root to run the tests.

```bash
```
sending-a-message-to-a-service$ bal test
Compiling source
integration_tutorials/sending_a_message_to_a_service:0.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Follow the instructions given in this section to develop the service.

1. Create a new Ballerina project using the `bal` command and open it in VS Code.

```bash
```
$ bal new sending-emails-from-a-service
```

Expand Down Expand Up @@ -614,7 +614,7 @@ function getEmailContent(int appointmentNumber, Appointment appointment, Payment

You can run this service by navigating to the project root and using the `bal run` command.

```bash
```
sending-emails-from-a-service$ bal run
Compiling source
integration_tutorials/sending_emails_from_a_service:0.1.0
Expand All @@ -630,7 +630,7 @@ Let's test the use case by sending a request to the service.

Download the JAR file for the [backend service](https://github.com/ballerina-guides/integration-tutorials/blob/main/backends/hospital-service/hospitalservice.jar) and execute the following command to start the service:

```bash
```
bal run hospitalservice.jar
```

Expand Down Expand Up @@ -662,7 +662,7 @@ Let's send a request to the service using cURL as follows.

3. Execute the following command.

```bash
```
curl -v -X POST --data @request.json http://localhost:8290/healthcare/categories/surgery/reserve --header "Content-Type:application/json"
```

Expand Down
8 changes: 4 additions & 4 deletions swan-lake/integration-tutorials/service-orchestration.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Follow the instructions given in this section to develop the service.

1. Create a new Ballerina project using the `bal` command and open it in VS Code.

```bash
```
$ bal new service-orchestration
```

Expand Down Expand Up @@ -563,7 +563,7 @@ service /healthcare on new http:Listener(port) {

You can run this service by navigating to the project root and using the `bal run` command.

```bash
```
service-orchestration$ bal run
Compiling source
integration_tutorials/service_orchestration:0.1.0
Expand All @@ -579,7 +579,7 @@ Let's test the use case by sending a request to the service.

Download the JAR file for the [backend service](https://github.com/ballerina-guides/integration-tutorials/blob/main/backends/hospital-service/hospitalservice.jar) and execute the following command to start the service:

```bash
```
bal run hospitalservice.jar
```

Expand Down Expand Up @@ -611,7 +611,7 @@ Let's send a request to the service using cURL as follows.

3. Execute the following command.

```bash
```
curl -v -X POST --data @request.json http://localhost:8290/healthcare/categories/surgery/reserve --header "Content-Type:application/json"
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Follow the instructions given in this section to develop the service.

1. Create a new Ballerina project using the `bal` command and open it in VS Code.

```bash
```
$ bal new transforming-message-formats
```

Expand Down Expand Up @@ -381,7 +381,7 @@ The [sequence diagram view](https://wso2.com/ballerina/vscode/docs/implement-the

You can run this service by navigating to the project root and using the `bal run` command.

```bash
```
transforming-message-formats$ bal run
Compiling source
integration_tutorials/transforming_message_formats:0.1.0
Expand All @@ -397,7 +397,7 @@ Let's test the use case by sending a request to the service.

Download the JAR file for the [backend service](https://github.com/ballerina-guides/integration-tutorials/blob/main/backends/hospital-service/hospitalservice.jar) and execute the following command to start the service:

```bash
```
bal run hospitalservice.jar
```

Expand Down Expand Up @@ -428,7 +428,7 @@ Let's send a request to the service using cURL as follows.

3. Execute the following command.

```bash
```
curl -v -X POST --data @request.json http://localhost:8290/healthcare/categories/surgery/reserve --header "Content-Type:application/json"
```

Expand Down
Loading

0 comments on commit c877086

Please sign in to comment.