oxedyne/fe2o3/fe2o3_steel/build
580 bytes, 1 run, executable
created by r1870400018:928, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | #!/bin/bash |
| 2 | |
| 3 | app="steel" |
| 4 | # Default to debug unless release specified |
| 5 | profile="debug" |
| 6 | build_flag="" |
| 7 | |
| 8 | clear |
| 9 | # Check if release argument provided |
| 10 | if [ $# -eq 1 ]; then |
| 11 | if [ "$1" == "release" ]; then |
| 12 | profile="release" |
| 13 | build_flag="--release" |
| 14 | else |
| 15 | echo "Error: only valid argument is 'release'" |
| 16 | exit 1 |
| 17 | fi |
| 18 | fi |
| 19 | |
| 20 | rm -f ./$app |
| 21 | |
| 22 | # Run cargo build |
| 23 | cargo build $build_flag |
| 24 | |
| 25 | # If build successful, copy executable |
| 26 | if [ $? -eq 0 ]; then |
| 27 | cp "../target/$profile/$app" . |
| 28 | echo "Copied $app from ../target/$profile/" |
| 29 | else |
| 30 | echo "Build failed" |
| 31 | exit 1 |
| 32 | fi |