FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
rustpython.github.io/scripts/whats_left_builtin_items.sh at master · RustPython/rustpython.github.io · GitHub
RustPython
rustpython.github.io
Repository navigation
Code
Issues
8
(8)
Pull requests
4
(4)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
rustpython.github.io
/
scripts
/
whats_left_builtin_items.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
39 lines (34 loc) · 952 Bytes
Breadcrumbs
rustpython.github.io
/
scripts
/
whats_left_builtin_items.sh
Copy path
File metadata and controls
executable file
·
39 lines (34 loc) · 952 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!
/bin/bash
set
-euo pipefail
#
paths where the script is located
SCRIPT_DIR=
"
$(
cd
"
$(
dirname
"
${BASH_SOURCE[0]}
"
)
"
&
>
/dev/null
&&
pwd
)
"
PROJECT_ROOT=
"
$(
cd
"
$SCRIPT_DIR
/..
"
&&
pwd
)
"
DATA_DIR=
"
$PROJECT_ROOT
/_data
"
TEMP_FILE=
"
$DATA_DIR
/whats_left.temp
"
OUTPUT_DIR=
"
$DATA_DIR
/whats_left
"
OUTPUT_FILE=
"
$OUTPUT_DIR
/builtin_items.csv
"
#
create directory if it doesn't exist
mkdir -p
"
$OUTPUT_DIR
"
#
exit violently if the temp file does not exist
if
[
!
-f
"
$TEMP_FILE
"
]
;
then
echo
"
error: input file
$TEMP_FILE
not found
"
>&2
exit
1
fi
#
generate the CSV file for builtin items from the temp file
awk -f -
"
$TEMP_FILE
"
>
"
$OUTPUT_FILE
"
<<
'
EOF
'
BEGIN {
OFS=","
print "builtin,name,is_inherited"
}
/^# builtin items/ { in_section=1; next }
/^$/ { if (in_section) exit }
in_section {
split($1, a, ".")
rest = ""
idx = index($0, " ")
if (idx > 0) {
rest = substr($0, idx+1)
}
print a[1], $1, rest
}
EOF
Back
|
FazBrowse Home
|
New Git URL