File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22set -euo pipefail
33
4+ # paths where the script is located
5+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd ) "
6+ PROJECT_ROOT=" $( cd " $SCRIPT_DIR /.." && pwd) "
7+
8+ DATA_DIR=" $PROJECT_ROOT /_data"
9+ TEMP_FILE=" $DATA_DIR /whats_left.temp"
10+ OUTPUT_DIR=" $DATA_DIR /whats_left"
11+ OUTPUT_FILE=" $OUTPUT_DIR /builtin_items.csv"
12+
413# create directory if it doesn't exist
5- mkdir -p ../_data/whats_left
14+ mkdir -p " $OUTPUT_DIR "
615
716# exit violently if the temp file does not exist
8- if [ ! -f ../_data/whats_left.temp ]; then
9- echo " error: input file ../_data/whats_left.temp not found" >&2
17+ if [ ! -f " $TEMP_FILE " ]; then
18+ echo " error: input file $TEMP_FILE not found" >&2
1019 exit 1
1120fi
1221
1322# generate the CSV file for builtin items from the temp file
14- awk -f - ../_data/whats_left.temp > ../_data/whats_left/builtin_items.csv << 'EOF '
23+ awk -f - " $TEMP_FILE " > " $OUTPUT_FILE " << 'EOF '
1524BEGIN {
1625 OFS=","
1726 print "builtin,name,is_inherited"
You can’t perform that action at this time.
0 commit comments