Skip to content

Commit b8647e9

Browse files
committed
add workflow.sh in README.md
1 parent e6634ee commit b8647e9

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

scripts/README.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,46 @@
1-
Some Scripts
1+
Helpful Scripts
22
============
33

4-
### comments.sh
4+
- [Helpful Scripts](#helpful-scripts)
5+
- [workflow.sh](#workflowsh)
6+
- [comments.sh](#commentssh)
7+
- [readme.sh](#readmesh)
8+
9+
## workflow.sh
10+
11+
`workflow.sh` - it's used to run a number of operations. It depends on `comments.sh` and `readme.sh`
12+
13+
For example:
14+
```
15+
$ cd leetcode/algorithms/cpp
16+
$ ../../scripts/workflow.sh https://leetcode.com/problems/design-authentication-manager/
17+
Step 1 : Created "designAuthenticationManager" directory!
18+
Step 2 : Created "designAuthenticationManager/DesignAuthenticationManager.cpp" source file!
19+
Step 3 : Run "git add designAuthenticationManager/DesignAuthenticationManager.cpp"!
20+
Step 4 : Edited the "designAuthenticationManagerDesignAuthenticationManager.cpp"!
21+
Step 5 : Copied the readme text to Clipboard!
22+
Step 6 : Edited the "README.md"!
23+
Step 7 : You can commit the changes by running the following command line...
24+
25+
git commit -am "New Problem Solution -\"Design Authentication Manager\""
26+
```
27+
28+
## comments.sh
529

630
`comments.sh` - it's used to generate author and problem description comments
731

832
> **Notes**:
933
> - The `comments.sh` is compatible for both Linux and Mac platfrom.
10-
> - The `comments.sh` needs [xidel](https://github.com/benibela/xidel) to grab & parse the html contents with filtering out the HTML tags. The script would check the `xidel` whether installed or not in your Linux box, if not, it will download via Github on Linux platform, and the run `brew install xidel` on Mac platfrom.
34+
> - The `comments.sh` needs [jq](https://stedolan.github.io/jq/) to grab & parse the json contents.
1135
> - The `comments.sh` currently can automatically detect the problem's type, if the problem is `algorithm` type, it's going to create `.cpp` file, if the problem is `shell` type, the `.sh` file will be created.
1236
1337
1) Create a file named largestNumber.cpp, and add Copyright & Problem description
14-
```
38+
```sh
1539
./comments.sh https://leetcode.com/problems/largest-number/
1640
```
1741

1842
2) Add Copyright & Problem description into existed file
19-
```
43+
```sh
2044
./comments.sh https://leetcode.com/problems/largest-number/ largestNumber.cpp
2145
```
2246

@@ -25,7 +49,7 @@ The comments would be generated by above examples as below:
2549
> **Notes**
2650
> If you need to customize the `Author` name, you have to change the `$AUTHOR` variable at the beginning of the scripts.
2751
28-
```
52+
```cpp
2953
// Source : https://oj.leetcode.com/problems/largest-number/
3054
// Author : Hao Chen
3155
// Date : 2015-01-25
@@ -45,13 +69,13 @@ The comments would be generated by above examples as below:
4569

4670
```
4771

48-
### readme.sh
72+
## readme.sh
4973

5074
`readme.sh` - it's used to generate the table item in README.md
5175

5276
For example:
5377

54-
```
78+
```sh
5579
$ ./readme.sh ../algorithms/cpp/nextPermutation/nextPermutation.cpp
5680
|31|[Next Permutation](https://oj.leetcode.com/problems/next-permutation/) | [C++](./algorithms/cpp/nextPermutation/nextPermutation.cpp)|Medium|
5781
```

scripts/workflow.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ else
6565
read -n 1 -s -r -p "Please copy the line above & press any key continue to edit README.md"
6666
fi
6767

68-
echo "Step 5: Copied the readme text to Clipboard!"
68+
echo "Step 5 : Copied the readme text to Clipboard!"
6969
vi ${SCRIPTPATH}/../README.md
70-
echo "Step 6: Edited the \"README.md\"!"
70+
echo "Step 6 : Edited the \"README.md\"!"
7171

72-
echo "Step 7: You can commit the changes by running the following command line..."
72+
echo "Step 7 : You can commit the changes by running the following command line..."
7373
echo ""
7474
echo " ${commit}"

0 commit comments

Comments
 (0)