Compare commits

..

No commits in common. "d0de9b5c6afe9878bd4d0a5149ef29b0b0bac87d" and "24827b2b844fcba202d916f57c8dfb65310eab17" have entirely different histories.

2 changed files with 212 additions and 227 deletions

View File

@ -0,0 +1,3 @@
institution,url,area,studyType,startDate,endDate,score,courses
"The University of Queensland",,"Software Engineering (incomplete)","Bachelors","2008-02-12","2009-12-12",,
"University of Technology","http://universityoftechnology.com","Computer Science","Bachelor","2010-09-01","2014-06-30","3.8 GPA","CS101 - Introduction to Computer Science; CS201 - Data Structures and Algorithms; CS301 - Operating Systems"
1 institution url area studyType startDate endDate score courses
2 The University of Queensland Software Engineering (incomplete) Bachelors 2008-02-12 2009-12-12
3 University of Technology http://universityoftechnology.com Computer Science Bachelor 2010-09-01 2014-06-30 3.8 GPA CS101 - Introduction to Computer Science; CS201 - Data Structures and Algorithms; CS301 - Operating Systems

View File

@ -32,8 +32,6 @@ META
} }
add_basics_section() add_basics_section()
{ {
@ -58,159 +56,28 @@ BASICS
} }
add_work_section()
# Bash Function to Append JSON
add_profiles_section ()
{ {
echo '{"profiles": [' >> $BUILD_OUTPUT_DIR/resume.json local input_file=$JSON_TEMPLATE_DIRECTORY/work.csv
while IFS=, read -r username url network; do cat << 'WORK_START'
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
{
"username": "$username",
"url": "$url",
"network": "$network"
},
EOF
done < $JSON_TEMPLATE_DIRECTORY/profiles.csv
# Remove trailing comma and close JSON array
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
} "work": [
WORK_START
add_certificates_section() awk -F, 'NR>1 {
printf " {\n"
{ printf " \"name\": \"%s\",\n", $1
printf " \"position\": \"%s\",\n", $2
echo '{"certificates": [' >> $BUILD_OUTPUT_DIR/resume.json printf " \"url\": \"%s\",\n", $3
while IFS=, read -r name date issuer url; do printf " \"startDate\": \"%s\",\n", $4
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json if ($5 != "") printf " \"endDate\": \"%s\",\n", $5
{ printf " \"summary\": \"%s\",\n", $6
"name": "$name", printf " \"highlights\": [\n \"%s\"\n ]\n", gensub(/\|/, "\",\n \"", "g", $7)
"date": "$date", printf " }%s\n", (NR==NR?"":",")
"issuer": "$issuer", }' "$input_file"
"url": "$url" cat << 'WORK_END'
}, ],
EOF WORK_END
done < $JSON_TEMPLATE_DIRECTORY/certificates.csv
# Remove trailing comma and close JSON array
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
}
add_education_section()
{
echo '{"education": [' >> $BUILD_OUTPUT_DIR/resume.json
while IFS=, read -r institution url area studyType startDate endDate score courses; do
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
{
"institution": "$institution",
"url": "$url",
"area": "$area",
"studyType": "$studyType",
"startDate": "$startDate",
"endDate": "$endDate",
"score": "$score",
"courses": [$(echo "$courses" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')]
},
EOF
done < $JSON_TEMPLATE_DIRECTORY/education.csv
# Remove trailing comma and close JSON array
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
}
add_references_section()
{
echo '{"references": [' >> $BUILD_OUTPUT_DIR/resume.json
while IFS=, read -r reference name; do
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
{
"reference": "$reference",
"name": "$name"
},
EOF
done < $JSON_TEMPLATE_DIRECTORY/references.csv
# Remove trailing comma and close JSON array
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
}
add_skills_section()
{
echo '{"skills": [' >> $BUILD_OUTPUT_DIR/resume.json
while IFS=, read -r name level keywords; do
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
{
"name": "$name",
"level": "$level",
"keywords": [$(echo "$keywords" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')]
},
EOF
done < $JSON_TEMPLATE_DIRECTORY/skills.csv
# Remove trailing comma and close JSON array
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
}
add_awards_section()
{
echo '{"awards": [' >> $BUILD_OUTPUT_DIR/resume.json
while IFS=, read -r title awarder date summary; do
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
{
"title": "$title",
"awarder": "$awarder",
"date": "$date",
"summary": "$summary"
},
EOF
done < $JSON_TEMPLATE_DIRECTORY/awards.csv
# Remove trailing comma and close JSON array
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
}
add_publications_section()
{
echo '{"publications": [' >> $BUILD_OUTPUT_DIR/resume.json
while IFS=, read -r name publisher releaseDate url summary; do
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
{
"name": "$name",
"publisher": "$publisher",
"releaseDate": "$releaseDate",
"url": "$url",
"summary": "$summary"
},
EOF
done < $JSON_TEMPLATE_DIRECTORY/publications.csv
# Remove trailing comma and close JSON array
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
} }
@ -218,93 +85,207 @@ add_volunteer_section()
{ {
echo '{"volunteer": [' >> $BUILD_OUTPUT_DIR/resume.json local input_file="$JSON_TEMPLATE_DIRECTORY/volunteer.csv"
while IFS=, read -r organization position url startDate summary highlights; do cat << 'VOLUNTEER_START' >> $BUILD_OUTPUT_DIR/resume.json
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
{
"organization": "$organization",
"position": "$position",
"url": "$url",
"startDate": "$startDate",
"summary": "$summary",
"highlights": [$(echo "$highlights" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')]
},
EOF
done < $JSON_TEMPLATE_DIRECTORY/volunteer.csv
# Remove trailing comma and close JSON array "volunteer": [
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json VOLUNTEER_START
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
awk -F, 'NR>1 {
printf " {\n"
printf " \"organization\": \"%s\",\n", $1
printf " \"position\": \"%s\",\n", $2
printf " \"url\": \"%s\",\n", $3
printf " \"startDate\": \"%s\",\n", $3
printf " \"endDate\": \"%s\",\n", $3
printf " \"summary\": \"%s\"\n", $4
printf " \"highlights\": ["
printf " " $7
printf " ]"
printf " }%s\n", (NR==NR?"":",")
}' "$input_file"
cat << 'VOLUNTEER_END'
],
VOLUNTEER_END
} }
add_work_section() add_awards_section()
{ {
echo '{"work": [' >> $BUILD_OUTPUT_DIR/resume.json local input_file=$JSON_TEMPLATE_DIRECTORY/awards.csv
while IFS=, read -r name position location website startDate endDate summary highlights; do cat << 'AWARDS_START' >> $BUILD_OUTPUT_DIR/resume.json
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json "awards": [
{ AWARDS_START
"name": "$name", awk -F, 'NR>1 {
"position": "$position", printf " {\n"
"location": "$location", printf " \"title\": \"%s\",\n", $1
"website": "$website", printf " \"date\": \"%s\",\n", $2
"startDate": "$startDate", printf " \"awarder\": \"%s\",\n", $3
"endDate": "$endDate", printf " \"summary\": \"%s\"\n", $4
"summary": "$summary", printf " }%s\n", (NR==NR?"":",")
"highlights": [$(echo "$highlights" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')] }' "$input_file"
}, cat << 'AWARDS_END'
EOF ],
done < $JSON_TEMPLATE_DIRECTORY/work.csv AWARDS_END
}
# Remove trailing comma and close JSON array
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json add_publications_section()
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
{
local input_file=$JSON_TEMPLATE_DIRECTORY/publications.csv
cat << 'PUBLICATIONS_START' >> $BUILD_OUTPUT_DIR/resume.json
"publications": [
PUBLICATIONS_START
awk -F, 'NR>1 {
printf " {\n"
printf " \"name\": \"%s\",\n", $1
printf " \"publisher\": \"%s\",\n", $2
printf " \"releaseDate\": \"%s\",\n", $3
printf " \"url\": \"%s\",\n", $4
printf " \"summary\": \"%s\"\n", $5
printf " }%s\n", (NR==NR?"":",")
}' "$input_file"
cat << 'PUBLICATIONS_END'
],
PUBLICATIONS_END
} }
add_volunteer_section()
{
local input_file=$JSON_TEMPLATE_DIRECTORY/volunteer.csv
cat << 'VOLUNTEER_START' >> $BUILD_OUTPUT_DIR/resume.json
"volunteer": [
VOLUNTEER_START
awk -F, 'NR>1 {
printf " {\n"
printf " \"organization\": \"%s\",\n", $1
printf " \"position\": \"%s\",\n", $2
printf " \"url\": \"%s\",\n", $3
printf " \"startDate\": \"%s\",\n", $4
printf " \"summary\": \"%s\",\n", $5
printf " \"highlights\": [\n \"%s\"\n ]\n", gensub(/\|/, "\",\n \"", "g", $6)
printf " }%s\n", (NR==NR?"":",")
}' "$input_file"
cat << 'VOLUNTEER_END'
],
VOLUNTEER_END
}
add_skills_section()
{
local input_file="$JSON_TEMPLATE_DIRECTORY/skills.csv"
cat << 'SKILLS_START' >> $BUILD_OUTPUT_DIR/resume.json
"skills": [
SKILLS_START
awk -F, 'NR>1 {
printf " {\n"
printf " \"keywords\": [\n \"%s\"\n ],\n", gensub(/\|/, "\",\n \"", "g", $3)
printf " \"level\": \"%s\",\n", $2
printf " \"name\": \"%s\"\n", $1
printf " }%s\n", (NR==NR?"":",")
}' "$input_file"
cat << 'SKILLS_END'
],
SKILLS_END
}
add_education_section()
{
local input_file="$JSON_TEMPLATE_DIRECTORY/education.csv"
cat << 'EDUCATION_START' >> $BUILD_OUTPUT_DIR/resume.json
"education": [
EDUCATION_START
awk -F, 'NR>1 {
printf " {\n"
printf " \"institution\": \"%s\",\n", $1
if ($2 != "") printf " \"url\": \"%s\",\n", $2
printf " \"area\": \"%s\",\n", $3
printf " \"studyType\": \"%s\",\n", $4
printf " \"startDate\": \"%s\",\n", $5
printf " \"endDate\": \"%s\"", $6
if ($7 != "") printf ",\n \"score\": \"%s\"", $7
if ($8 != "") printf ",\n \"courses\": [\n \"%s\"\n ]", gensub(/\|/, "\",\n \"", "g", $8)
printf "\n }%s\n", (NR==NR?"":",")
}' "$input_file"
cat << 'EDUCATION_END'
],
EDUCATION_END
}
add_languages_section() add_languages_section()
{ {
echo '{"languages": [' >> $BUILD_OUTPUT_DIR/resume.json local input_file="$JSON_TEMPLATE_DIRECTORY/languages.csv"
while IFS=, read -r language fluency; do cat << 'LANGUAGES_START' >> $BUILD_OUTPUT_DIR/resume.json
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json "languages": [
{ LANGUAGES_START
"language": "$language", awk -F, 'NR>1 {
"fluency": "$fluency" printf " {\n"
}, printf " \"language\": \"%s\",\n", $1
EOF printf " \"fluency\": \"%s\"\n", $2
done < $JSON_TEMPLATE_DIRECTORY/languages.csv printf " }%s\n", (NR==NR?"":",")
}' "$input_file"
# Remove trailing comma and close JSON array cat << 'LANGUAGES_END'
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json ],
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json LANGUAGES_END
} }
add_interests_section() add_interests_section()
{ {
local input_file="$JSON_TEMPLATE_DIRECTORY/interests.csv"
echo '{"interests": [' >> $BUILD_OUTPUT_DIR/resume.json cat << 'INTERESTS_START' >> $BUILD_OUTPUT_DIR/resume.json
while IFS=, read -r name keywords; do "interests": [
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json INTERESTS_START
{ awk -F, 'NR>1 {
"name": "$name", printf " {\n"
"keywords": [$(echo "$keywords" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')] printf " \"name\": \"%s\",\n", $1
}, printf " \"keywords\": [\n \"%s\"\n ]\n", gensub(/\|/, "\",\n \"", "g", $2)
EOF printf " }%s\n", (NR==NR?"":",")
done < $JSON_TEMPLATE_DIRECTORY/interests.csv }' "$input_file"
cat << 'INTERESTS_END'
# Remove trailing comma and close JSON array ],
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json INTERESTS_END
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
} }
add_references_section()
{
local input_file="$JSON_TEMPLATE_DIRECTORY/references.csv"
cat << 'REFERENCES_START' >> $BUILD_OUTPUT_DIR/resume.json
"references": [
REFERENCES_START
awk -F, 'NR>1 {
printf " {\n"
printf " \"name\": \"%s\",\n", $1
printf " \"reference\": \"%s\"\n", $2
printf " }%s\n", (NR==NR?"":",")
}' "$input_file"
cat << 'REFERENCES_END'
]
REFERENCES_END
}
add_close_section() add_close_section()
{ {
@ -318,19 +299,20 @@ main()
{ {
add_open_section add_open_section
add_meta_section add_meta_section $JSON_TEMPLATE_DIRECTORY/meta.csv
add_basics_section add_basics_section $JSON_TEMPLATE_DIRECTORY/basics.csv
add_profiles_section add_profiles_section $JSON_TEMPLATE_DIRECTORY/profiles.csv
add_work_section add_work_section $JSON_TEMPLATE_DIRECTORY/work.csv
add_volunteer_section add_volunteer_section $JSON_TEMPLATE_DIRECTORY/volunteer.csv
add_education_section add_education-section $JSON_TEMPLATE_DIRECTORY/education.csv
add_awards_section add_awards_section $JSON_TEMPLATE_DIRECTORY/awards.csv
add_certificates_section add_certificates_section $JSON_TEMPLATE_DIRECTORY/certificates.csv
add_publications_section add_publications_section $JSON_TEMPLATE_DIRECTORY/publications.csv
add_skills_section add_skills_section $JSON_TEMPLATE_DIRECTORY/skills.csv
add_languages_section add_languages_section $JSON_TEMPLATE_DIRECTORY/languages.csv
add_interests_section add_interests_section $JSON_TEMPLATE_DIRECTORY/interests.csv
add_references_section add_references_section $JSON_TEMPLATE_DIRECTORY/references.csv
add_projects_section $JSON_TEMPLATE_DIRECTORY/projects.csv
add_close_section add_close_section
} }