|
1 | 1 | # How to Run the Shell Script
|
2 | 2 |
|
3 |
| -### If changes are made to your html or css you will need to follow these instructions |
4 |
| -(Windows Users Only) |
| 3 | +If changes are made to your html or css you will need to regenerate it by running the `hex2c.sh` shell script. |
| 4 | + |
| 5 | +### OSX/Linux |
| 6 | + |
| 7 | +Just run the command on the file you want to regenerate, piping the output to the destination file. For example, to regenerate the range finder scanner's `index.html` file, you would run the following command: |
| 8 | + |
| 9 | +``` |
| 10 | +./docs/cpp/bin/hex2c.sh ./range-finder-scanner/cpp/html/index.html > ./range-finder-scanner/cpp/src/html.h |
| 11 | +``` |
| 12 | + |
| 13 | +The resulting `html.h` contains the hex encoded version of the `index.html` as a C header file. This allows a single file executable with all assets included in the file itself, hence no external dependencies. |
| 14 | + |
| 15 | +### Windows |
5 | 16 |
|
6 | 17 | 1. Go to https://cygwin.com/
|
7 | 18 | 
|
8 | 19 |
|
9 | 20 | 2. Go to the downloads section.
|
10 | 21 | 
|
11 | 22 |
|
12 |
| -3. Download and run the exe. |
| 23 | +3. Download and run the exe. |
13 | 24 | 
|
14 | 25 |
|
15 | 26 | 4. Only use default install!!! Download will be several gigabytes if you install all.
|
|
33 | 44 | 10. Open your windows command promt.
|
34 | 45 | 
|
35 | 46 |
|
36 |
| -11. Find the directory the your shell script command is as well as your html and css files. For ease of use I put them in the same folder on my desktop. Now type "hex2c.sh index.html" |
| 47 | +11. Find the directory the your shell script command is as well as your html and css files. For ease of use I put them in the same folder on my desktop. Now type "hex2c.sh index.html" |
37 | 48 | 
|
38 | 49 |
|
39 | 50 | 12. You may have to change the height and wisth of your command prompt for everything to fit.
|
40 | 51 | 
|
41 | 52 |
|
42 |
| -13. Copy the hex code completly. Right click at the top bar of the command promt. Click edit -> mark. |
| 53 | +13. Copy the hex code completly. Right click at the top bar of the command promt. Click edit -> mark. |
43 | 54 | 
|
44 | 55 |
|
45 | 56 | 14. You can now hightlight the whole file. Press enter to copy.
|
46 | 57 | 
|
47 | 58 |
|
48 |
| -15. Finally open a new text document and paste the code inside. Then rename the document html.h and you now have the file you need if you modified your html or css. |
49 |
| - |
| 59 | +15. Finally open a new text document and paste the code inside. Then rename the document html.h and you now have the file you need if you modified your html or css. |
| 60 | + |
0 commit comments